23.04.2011, 04:41
pawn Код:
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(!strcmp(pname, "justin bieber", true))
{
Kick(playerid);
return 0;
}
if(strlen(pname) > 12) // Will kick the player if his name is longer than 12 characters.
{
SendClientMessage(playerid, COLOR_RED, "Your name is too long, It must be 12 or less characters.");
Kick(playerid);
return 0;
}
SendClientMessage(playerid, COLOR_GREEN, "PLEASE USE /help FOR SOME SERVER INFO AND COMMANDS");
UsePlayerPedAnims();
UpdateTimeForAll();
format(str, sizeof(str), USERFILE, pname);
new ip[24];
GetPlayerIp(playerid, ip, sizeof(ip));
if(!fexist(str))
{
djAutocommit(false);
djCreateFile (str);
djSet(str,"player/NAME", pname);
djSetInt(str,"player/SCORE",GetPlayerScore(playerid));
djSetInt(str,"player/CASH",GetPlayerMoney(playerid));
djSet(str,"player/IP", ip);
djCommit(str);
djAutocommit(true);
}
else
{
if(!strcmp(ip, dj(str, "player/IP")))
{
SetPlayerScore(playerid, djInt(str, "player/SCORE"));
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, djInt(str, "player/CASH"));
}
else
{
new string[128];
format(string, sizeof(string), "YOU ARENT THE REAL %s!! GTFO!", pname);
SendClientMessage(playerid, COLOR_RED, string);
Kick(playerid);
return 0;
}
}
return 1;
}





