SA-MP Forums Archive
setlvl zcmd convert - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: setlvl zcmd convert (/showthread.php?tid=348812)



setlvl zcmd convert - thefatshizms - 06.06.2012

could u plz convert this to zcmd

pawn 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];
    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


Re: setlvl zcmd convert - Infinity90 - 06.06.2012

Here,
pawn Code:
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;
}



Re: setlvl zcmd convert - thefatshizms - 06.06.2012

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 © 1997-2006, ITB CompuPhase


5 Errors.
line 70-76
pawn Code:
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[])