[INFO]IsPlayerConnected
#2

Why in the heck do you use for loop?
Here you go;
Compare these two to yours, and see what's the differences.
pawn Код:
public OnPlayerConenct(playerid) {
    format(stringa, sizeof stringa, "%s (ID:%d) has joined the server", GetPlayerNameEx(playerid), playerid);
    SendClientMessageToAll(-1, stringa);
    GameTextForPlayer(playerid, "~b~Benvenuto su~n~~g~I~w~L~r~V ~y~SA-MP Server~n~~b~Versione~n~~r~v0.1~n~~b~Ultimo aggiornamento~n~~r~31/07/2011", 7000, 3);    //GAMETEXTFORPLAYER
    return 1;
}
pawn Код:
public OnPlayerDisconenct(playerid) {
    switch(reason) {
        case 0: format(stringa, sizeof stringa, "%s has left the server (Crash)", GetPlayerNameEx(playerid));
        case 1: format(stringa, sizeof stringa, "%s has left the server", GetPlayerNameEx(playerid));
        case 2: format(stringa, sizeof stringa, "%s has left the server (Kicked/Banned)", GetPlayerNameEx(playerid));
    }
    SendClientMessageToAll(-1, stringa);
    return 1;
}
This function returns the player his name faster and easier.
pawn Код:
stock GetPlayerNameEx(playerid) {
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    return PlayerName;
}
EDIT: If you are a beginner, that is still good but compare the differences so your knowledge would be higher.
Reply


Messages In This Thread
[INFO]IsPlayerConnected - by TheBluec0de - 31.07.2011, 18:24
Re: [INFO]IsPlayerConnected - by Toreno - 31.07.2011, 18:32
Re: [INFO]IsPlayerConnected - by TheBluec0de - 31.07.2011, 18:35
Re: [INFO]IsPlayerConnected - by Toreno - 31.07.2011, 18:38

Forum Jump:


Users browsing this thread: 1 Guest(s)