20.06.2011, 18:04
hey guyz i've been tried hardly and trying to fix but i can't
this is the code
and its not working when i put
then it must say:
but it don't ,
it says : "You have set MBX97's level to 0" , why i can't choose the level either the person id ?
please fix it guyz
and thanks alot for reading
this is the code
pawn Код:
if(strcmp("/setadmin", cmdtext, true, 10) == 0)
{
new level,playerid2,file[256],PlayerName[MAX_PLAYER_NAME],PlayerName2[MAX_PLAYER_NAME];
new tmp2[256], Index,str[50],str2[50];
tmp = strtok(cmdtext,Index), tmp2 = strtok(cmdtext,Index),playerid2 = strval(tmp),level = strval(tmp2);
GetPlayerName(playerid2,PlayerName,MAX_PLAYER_NAME);
GetPlayerName(playerid,PlayerName2,sizeof(PlayerName2));
format(file,sizeof(file),"NewServer/Admins/%s.txt",PlayerName);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_YELLOW,"You need be RCON to use this command!");
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /setlevel id level");
if(level > 5 ) return SendClientMessage(playerid,COLOR_YELLOW,"Incorrect Level");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,COLOR_YELLOW,"Player is not connected!");
PlayerInfo[playerid][pAdminLevel] = level;
dini_IntSet(file,"Level",level);
format(str,sizeof(str),"* You have set %s's level to %d",PlayerName,level);
SendClientMessage(playerid,COLOR_BLUE,str);
format(str2,sizeof(str2),"* Admin '%s' has made you level %d",PlayerName2,level);
SendClientMessage(playerid2,COLOR_BLUE,str);
GameTextForPlayer(playerid2, "~r~Promoted", 5000, 3);
return 1;
}
pawn Код:
/setadmin
Код:
Usage: /setlevel id level
it says : "You have set MBX97's level to 0" , why i can't choose the level either the person id ?
please fix it guyz
and thanks alot for reading