Zapadni Balkan SA:MP Wiki
Advertisement

Ovaj callback se poziva kada igrac napusti server

Parametri

(playerid, reason)
playerid - ID igraca koji napusta server
reason - razlog izlaska
Return - Ovaj callback ne zahteva specifican return

Razlozi

0 - Timed Out (Igubio konekciju ili crashovao server)
1 - Izasao normalno (/quit (/q) ili ESC pa Exit)
2 - Kikovan ili Banovan (server zatvorio konekciju)

Primer

public OnPlayerDisconnect(playerid, reason)
{
    new
        szString[64],
        name[MAX_PLAYER_NAME];
 
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
 
    switch(reason)
    {
        case 0: format(szString, sizeof szString, "%s je napustio server. (Timed Out/Crashed)", name);
        case 1: format(szString, sizeof szString, "%s je napustio server. (Napusta)", name);
        case 2: format(szString, sizeof szString, "%s je napustio server. (Kikovan / Banovan)", name);
    }
 
    SendClientMessageToAll(0xC4C4C4FF, szString);
    return 1;
}
Advertisement