09.09.2010, 02:47
Can someone tell me why this wont work? I tried enough on it and can't get it to work.
Thanks in advance.
pawn Код:
dcmd_setlevel(playerid,params[])
{
new level,id,file[256],n[MAX_PLAYER_NAME], tmp[256], tmp2[256], Index,str[50];
tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),level = strval(tmp2);
GetPlayerName(id,n,MAX_PLAYER_NAME); format(file,sizeof(file),"FAdmin/Users/%s.sav",n);
if(PlayerInfo[playerid][Level] >= 6 || IsPlayerAdmin(playerid)) {
if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /setlevel <ID> <Level>");
if(!IsPlayerConnected(id)) {
if(level > 8 || level < 0) return SendClientMessage(playerid,red,"Invalid Level");
format(str,sizeof(str),"~b~~h~~h~New ~g~admin level ~w~level (%d)",level);
GameTextForPlayer(id,str,5000, 3);
PlayerInfo[id][Level] = level;
dini_IntSet(file,"Level",level);
} else return SendERROR(playerid, 3);
} else return SendERROR(playerid, 1);
return 1;
}