Convert dcmd to zcmd+sscanf
#1

Hello, i am trying to set this command:

Code:
dcmd_setlevel(playerid,params[])
{
	new level,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
	new tmp[256], tmp2[256], Index,str[50];// creating the new variables
	tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),level = strval(tmp2);// setting them to strtok so we can use them as parameters of our command
	GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name
	format(file,sizeof(file),"gAdmin/Users/%s.txt",n);//formatting the file
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,GREY,"You are not an RCON admin!");//if the player is not rcon admin
	if(!strlen(params)) return SendClientMessage(playerid,GREY,"USAGE: /setlevel <ID> <Level>");// if the string is empty
	if(!IsPlayerConnected(id))return SendClientMessage(playerid,GREY,"You have entered an incorrect ID"); //if the id is not connected
	PInfo[id][Level] = level;//sets the level of the player
		dini_IntSet(file,"Level",level);//saves the new level to the file
		format(str,sizeof(str),"You have set %s's level to %d",n,level);//creates the string
		SendClientMessage(playerid,LIGHTBLUE,str);
		return 1;
	}
To ZCMD, but the problem is when i use it it says that strtok is not defined, i know i have to use Sscanf for it but i have no idea how to implement sscanf in there...

Can anybody help me?

Thanks in advance!
Reply


Messages In This Thread
Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 17:53
Re: Convert dcmd to zcmd+sscanf - by ]Rafaellos[ - 28.03.2016, 18:10
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:13
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 18:16
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:21
Re: Convert dcmd to zcmd+sscanf - by ]Rafaellos[ - 28.03.2016, 18:23
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:27
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 19:31
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 19:59
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)