SA-MP Forums Archive
OnPlayer and all that - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayer and all that (/showthread.php?tid=502923)



OnPlayer and all that - JoanB - 26.03.2014

Okey guys so i got the blank script and i gonna start a basic script i would like to get told how edit like OnPlayerConnect (Playerid) there should be a text and OnPlayerDeath there should be a text could you just tell me that and maybe send me a link how to create bottoms like press YES if you wanna report or NO if you don't want to report.


Re: OnPlayer and all that - JoanB - 26.03.2014

And how do i like edit when i got many AddPlayerClass there should be like text when they change to the next character like the name of the character like TIMMY
Grandmother GRANDFATHER Onkel Police Timmy Detective


Re: OnPlayer and all that - TLN - 26.03.2014

Is this what you meant about OnPlayerConnect? (added OnPlayerDisconnect)
pawn Код:
public OnPlayerConnect(playerid)
{
    new String[128], Playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Playername, sizeof(Playername));
    format(String, sizeof(String),"%s(%d) Has Joined The Server", Playername, playerid);
    SendClientMessageToAll(0xAFAFAFAA, String);
    return 1;
}
pawn Код:
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(%d) Has Left The Server - (Timeout / Crash)", pname, playerid);
        case 1: format(string, sizeof(string), "%s(%d) Has Left The Server - (Leaving / Quit)", pname, playerid);
        case 2: format(string, sizeof(string), "%s(%d) Has Left The Server - (Kicked / Banned)", pname, playerid);
    }
    SendClientMessageToAll(0xAFAFAFAA, string);
    return 1;
}