28.05.2010, 04:56
ok here the code
and
Код:
public OnPlayerConnect(playerid) { new string[256],PlayerName[24],file[256]; file = GetPlayerFile(playerid); GetPlayerName(playerid,PlayerName,24); if(!dini_Exists(file)) CreateUserConfigFile(playerid); for(new i = 0; i < 100; i++) { if(strfind(PlayerName,ForbidNames[i],true)!=-1 && Config[ForbidData]) { switch(Config[ForbidData]) { case 1: Kick(playerid); case 2: Ban(playerid); } return 1; } }
Код:
public OnPlayerDisconnect(playerid,reason) { new Reason[256],string[256],name[24]; GetPlayerName(playerid,name,24); switch(reason) { case 0: Reason = "Timed Out"; case 1: Reason = "Leaving"; case 2: Reason = "Kick/Ban"; } format(string,256,"*** %s has left the server. (%s)",name,Reason); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && i != playerid) SendClientMessage(i,grey,string); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && Spec[i][SpectateID] == playerid && Spec[i][Spectating]) { TogglePlayerSpectating(i,false); Spec[i][Spectating] = false, Spec[i][SpectateID] = INVALID_PLAYER_ID; } return 1; }