13.08.2017, 02:59
Hello guys, is it worth checking if there is another player has the same name with the player who is connecting to the server?
Please help me, thanks in advanced.
PHP код:
public OnPlayerConnect(playerid)
{
foreach(new i: Player)
{
if(i == playerid) continue;
if(!strcmp(GetPlayerNameEx(playerid), GetPlayerNameEx(i)))
{
System_Scm(playerid, "There is another player online with this username", TYPE_ERROR);
Kick(playerid);
return 1;
}
}
ResetCharacter(playerid);
ClearChat(playerid);
gCharacterLogged[playerid] = false;
TogglePlayerSpectating(playerid, 1);
SetPVarInt(playerid, "FirstConnection", 1);
CreateCharacterNameTag(playerid);
CreateCharacterTextDraws(playerid);
BlacklistCheck(playerid);
RemoveObjects(playerid);
return 1;
}