08.07.2011, 21:49
(
Последний раз редактировалось Matz; 09.07.2011 в 09:55.
)
Hello everybody. I have a tiny script for rp server. Its checks nicknames for _ character. If you login with Mark_Antony (Example) you can play, if you login without _ character you will be kicked. But I want to when I login with "Admin" name without _ character, i wont get kick.
This code not working. How can fix that ?
This code not working. How can fix that ?
pawn Код:
public OnPlayerConnect(playerid)
{
new adname[MAX_PLAYER_NAME];
GetPlayerName(playerid, adname, sizeof(adname));
new adnamestring = strfind(adname, "Admin", true);
if(adnamestring == -1)
{
SendClientMessage(playerid, COLOR_BM, ">> OK you are an admin, wait for login..");
return 1;
}
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
new namestring = strfind(plname, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_BM, ">> Bad nickname.");
SendClientMessage(playerid, COLOR_BM, ">> Name type: Firstname_Lastname.");
Kick(playerid);
return 1;
}
return 1;
}