SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/06/2012, 07:49 PM   #1
thefatshizms
High-roller
 
thefatshizms's Avatar
 
Join Date: Dec 2011
Location: England
Posts: 1,745
Reputation: 259
Default setlvl zcmd convert

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
__________________
SFCNR ******* | SFCNR Forum
thefatshizms is offline   Reply With Quote
Old 06/06/2012, 07:52 PM   #2
Infinity90
Gangsta
 
Infinity90's Avatar
 
Join Date: Feb 2012
Location: United Kingdom
Posts: 511
Reputation: 38
Default Re: setlvl zcmd convert

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;
}
__________________
Coding for money.
______________________________________________
You need to give respect to earn it.
______________________________________________
My Work
Dynamic Entrance System
EasyScript System
Infinity90 is offline   Reply With Quote
Old 06/06/2012, 08:03 PM   #3
thefatshizms
High-roller
 
thefatshizms's Avatar
 
Join Date: Dec 2011
Location: England
Posts: 1,745
Reputation: 259
Default Re: setlvl zcmd convert

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
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[])
__________________
SFCNR ******* | SFCNR Forum
thefatshizms is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert to zcmd? remyguys Scripting Help 14 27/11/2011 05:22 PM
Convert To ZCMD Mr.McGuire Scripting Help 11 25/11/2011 08:30 AM
[help]convert to zcmd antonio600x Scripting Help 1 13/10/2011 07:13 AM
Convert to ZCMD. Lynn Scripting Help 5 01/09/2011 04:34 PM


All times are GMT. The time now is 06:46 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.