Help setlevel
#1

Hi

Can someone fix that if I dont insert ID and level it will send me message "USAGE: /setlevel <ID> <Level>"

PHP код:
CMD:setlevel(playerid,params[])
{
new 
level,id,file[256],n[MAX_PLAYER_NAME];
new 
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),"MyAdmin/Users/%s.txt",n);
if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,GREY,"You are not an RCON admin!");
if(!
strlen(params)) return SendClientMessage(playerid,GREY,"USAGE: /setlevel <ID> <Level>");
if(!
IsPlayerConnected(id))return SendClientMessage(playerid,GREY,"You have entered an incorrect ID");
if(
level || level 5) return SendClientMessage(playeridORANGE"Level must be between 0 and 5!");
PInfo[id][Level] = level;
dini_IntSet(file,"Level",level);
format(str,sizeof(str),"You have set %s's level to %d",n,level);
SendClientMessage(playerid,LIGHTBLUE,str);
return 
1;

Reply


Messages In This Thread
Help setlevel - by kalanerik99 - 03.05.2013, 09:42
Re: Help setlevel - by zombieking - 03.05.2013, 09:51
Re : Help setlevel - by Rayan_black - 03.05.2013, 10:05
Re: Help setlevel - by kalanerik99 - 03.05.2013, 10:12
Re : Re: Help setlevel - by Rayan_black - 03.05.2013, 10:15
Re: Help setlevel - by kalanerik99 - 03.05.2013, 10:16
Re: Help setlevel - by Isolated - 03.05.2013, 10:17
Re : Re: Help setlevel - by Rayan_black - 03.05.2013, 10:20
Re: Help setlevel - by Isolated - 03.05.2013, 10:25
Re : Re: Help setlevel - by Rayan_black - 03.05.2013, 10:30

Forum Jump:


Users browsing this thread: 3 Guest(s)