OnPlayerConnect bug
#6

This should work.

PHP код:
public OnPlayerDisconnect(playeridreason) {
    new 
pname[MAX_PLAYER_NAME], string[39 MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnamesizeof(pname));
    switch(
reason) {
        case 
0format(stringsizeof(string), "%s has left the server. (Lost Connection)"pname);
        case 
1format(stringsizeof(string), "%s has left the server. (Leaving)"pname);
        case 
2format(stringsizeof(string), "%s has left the server. (Kicked)"pname);
    }
    for(new 
i,j=GetPlayerPoolSize();i<=j;i++) { 
        if(!
IsPlayerConnected(i) || IsPlayerAdmin(i)) continue; 
        
SendClientMessage(i, -1string);
    }
    return 
1;

EDIT: Fixed a typo, my bad.
Reply


Messages In This Thread
OnPlayerConnect bug - by DRP - 17.01.2016, 12:47
Re: OnPlayerConnect bug - by GeneralAref - 17.01.2016, 12:54
Re: OnPlayerConnect bug - by DRP - 17.01.2016, 12:59
Re: OnPlayerConnect bug - by PrO.GameR - 17.01.2016, 14:22
Re: OnPlayerConnect bug - by DRP - 17.01.2016, 14:28
Re: OnPlayerConnect bug - by d1git - 17.01.2016, 14:38
Re: OnPlayerConnect bug - by DRP - 17.01.2016, 14:40

Forum Jump:


Users browsing this thread: 1 Guest(s)