Jump to content

Cerere tutorial


k1nd3r

Recommended Posts

Nume: Gabi

Nume tutorial: Cine se conecteaza pe server

Descriere: Vreau sa imi apara cine se conecteaza si se deconecteaza de pe server.

Poftim :

public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has joined the server", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}
Si :
public OnPlayerDisconnect(playerid, reason)
{
    new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname)); 
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
    } 
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}

"Maxim respect pentru orice proiect

Nimeni nu poate sa va scape cand va execut direct"

Link to comment
Share on other sites

Multumesc mult,+1Respect, dar sub ce functie le pun? Uitati ce erori imi da:

[pawn]D:\Servere\CrazyGaming\gamemodes\xqs.pwn(4689) : error 021: symbol already defined: "Streamer_OnPlayerConnect"

D:\Servere\CrazyGaming\gamemodes\xqs.pwn(5368) : error 021: symbol already defined: "Streamer_OnPlayerDisconnect"

D:\Servere\CrazyGaming\gamemodes\xqs.pwn(5560) : warning 209: function "Streamer_OnPlayerDisconnect" should return a value

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

[/pawn]

Link to comment
Share on other sites

 new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has joined the server", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}
Asta pui sub
 public OnPlayerConnect
Iar asta :
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname)); 
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
    } 
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}
sub
public OnplayerDisconnect

"Maxim respect pentru orice proiect

Nimeni nu poate sa va scape cand va execut direct"

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.