04.02.2011, 12:06
pawn Код:
dcmd_adminreg(playerid, params[])
{
#pragma unused params
new playerfile[100];
if(registered[playerid] == 1) return SendClientMessage(playerid, red, "ACCOUNT You are already registered in.");
if(!strlen(params))SendClientMessage(playerid, COLOR_GREY, "|| USAGE /adminreg [password] ||");
if(dini_Exists(playerfile))SendClientMessage(playerid, COLOR_RED, "ACCOUNT This playername is already registered you admin account! Please use /adminlog [password] to log into admin account");
if(strlen(params) < 5) return SendClientMessage(playerid,red,"ACCOUNT: Password must be than 5 characters");
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "/maxadmin/users/%s.ini",pname);
new playerip[20];
GetPlayerIp(playerid, playerip, sizeof(playerip));
dini_Create(playerfile);
dini_Set(playerfile,"password",params);
dini_Set(playerfile, "Ip", playerip);
dini_IntSet(playerfile, "Level", 0);
dini_IntSet(playerfile, "Cash", 0);
dini_IntSet(playerfile, "Score", 0);
dini_IntSet(playerfile, "Banned", 0);
dini_IntSet(playerfile, "Jailed", 0);
dini_IntSet(playerfile, "Kills", 0);
dini_IntSet(playerfile, "Deaths", 0);
dini_IntSet(playerfile, "Freezed", 0);
dini_IntSet(playerfile, "Muted", 0);
logged[playerid] = 0;
SendClientMessage(playerid, COLOR_GREEN, "ACCOUNT: You Have Created You'r Admin Account! Please Type /adminlog [password] To Log Into Your Admin Account!.");
return 1;
}