PDA

View Full Version : setlvl zcmd convert


thefatshizms
06/06/2012, 07:49 PM
could u plz convert this to zcmd

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];
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),"MyAdmin/Users/%s.txt",n);//formatting the file

and also sscanf

i dunno how

Infinity90
06/06/2012, 07:52 PM
Here,

CMD:setlevel(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new targetid, amount;
if(sscanf(params, "as", targetid, amount)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setlevel [id] [Amount]");
}
new level,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
new tmp[256], tmp2[256], Index,str[50];
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),"MyAdmin/Users/%s.txt",n);//formatting the file
return 1;
}

thefatshizms
06/06/2012, 08:03 PM
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(71) : error 017: undefined symbol "strtok"
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(74) : error 079: inconsistent return types (array & non-array)
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(71) : warning 217: loose indentation
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(76) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(76) : error 017: undefined symbol "cmd_givecar"
C:\Users\iphone\Desktop\0.3e\filterscripts\Event_F s.pwn(76) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
line 70-76
new tmp[256], tmp2[256], Index,str[50];
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),"MyAdmin/Users/%s.txt",n);//formatting the file
return 1;
}
CMD:givecar(playerid,params[])