setlvl zcmd convert
#1

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
Reply
#2

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;
}
Reply
#3

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[])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)