16.09.2016, 02:21
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdmin] == 0 && strfind(name,"_",true)== -1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a roleplay server. Please reconnect using a Firstname_Lastname format (E.G John_Smith).");
format(string, sizeof(string), "%s was kicked: Non-RP name", name);
SendClientMessageToAll(0xC4C4C4FF, string);
SetTimerEx("KickTimer",1000,false,"i", playerid);
return 1;
}
if(IsPlayerNPC(playerid))
{
printf("NPC: OnPlayerRequestClass: %d", playerid);
return 1;
}
if(gPlayerLogged[playerid] == 0)
{
switch(gPlayerAccount[playerid])
{
case 0: DisplayDialogForPlayer(playerid, 2); //register
case 1: DisplayDialogForPlayer(playerid, 1); //login
}
}
SetupPlayerForClassSelection(playerid);
if(gPlayerSpawned[playerid] == 1)
{
if(PlayerInfo[playerid][pMember] > 0 || PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pFMember] != 255)
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
else
{
PlayerInfo[playerid][pModel] = PedSkins[classid][0];
}
}
else
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
return 1;
}
I want players without an underscore to be kicked, but not admins..
How can I make this work? Thank you!