SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 07/01/2011, 03:14 PM   #1
nuriel8833
High-roller
 
nuriel8833's Avatar
 
Join Date: Jun 2009
Location: Israel
Posts: 1,158
Reputation: 16
Default Transforming zcmd's commands to regular commands

Hello
I downloaded a script which comes in zcmd's commands.
But my server is with regular commands,so I need to transform them to regular commands.
But the problem is that I don't know how.
(for example,here is one of the commands:
pawn Code:
CMD:startautorace(playerid, params[])
)

Can someone help me?
Thanks
__________________
Back to forums
Although I am not scripting much,only my gamemode on my free time

My works:
80.179.219.89:7778
[Tutorial] Kills Table BonusLast.fm
nuriel8833 is offline  
Old 07/01/2011, 03:19 PM   #2
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: Transforming zcmd's commands to regular commands

Quote:
Originally Posted by Montserrat View Post
But my server is with regular commands,so I need to transform them to regular commands.
I'm sorry? You mean to strcmp? If so,

pawn Code:
CMD:startautorace(playerid, params[])

to:

pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
__________________
Jochemd is offline  
Old 07/01/2011, 03:21 PM   #3
HyperZ
High-roller
 
HyperZ's Avatar
 
Join Date: Aug 2009
Posts: 1,340
Reputation: 66
Default Re: Transforming zcmd's commands to regular commands

pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)
__________________
HyperZ is offline  
Old 07/01/2011, 03:32 PM   #4
nuriel8833
High-roller
 
nuriel8833's Avatar
 
Join Date: Jun 2009
Location: Israel
Posts: 1,158
Reputation: 16
Default Re: Transforming zcmd's commands to regular commands

Quote:
Originally Posted by Jochemd View Post
I'm sorry? You mean to strcmp? If so,

pawn Code:
CMD:startautorace(playerid, params[])

to:

pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
yes strcmp
Thanks a lot to both of you!
Edit: the pawno crashes every time I am trying to compile /=
__________________
Back to forums
Although I am not scripting much,only my gamemode on my free time

My works:
80.179.219.89:7778
[Tutorial] Kills Table BonusLast.fm
nuriel8833 is offline  
Old 07/01/2011, 03:34 PM   #5
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: Transforming zcmd's commands to regular commands

Show the code you've changed
__________________
Jochemd is offline  
Old 07/01/2011, 03:40 PM   #6
nuriel8833
High-roller
 
nuriel8833's Avatar
 
Join Date: Jun 2009
Location: Israel
Posts: 1,158
Reputation: 16
Default Re: Transforming zcmd's commands to regular commands

pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
    if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
    if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> It's already enabled!");
    LoadRaceNames();
    LoadAutoRace(RaceNames[random(TotalRaces)]);
    AutomaticRace = true;
    SendClientMessage(playerid, GREEN, ">> You stared auto race. The filterscript will start a random race everytime the previous race is over!");
    return 1;
}
__________________
Back to forums
Although I am not scripting much,only my gamemode on my free time

My works:
80.179.219.89:7778
[Tutorial] Kills Table BonusLast.fm
nuriel8833 is offline  
Old 07/01/2011, 03:48 PM   #7
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: Transforming zcmd's commands to regular commands

pawn Code:
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");

I think it's that. Probably that 0x01 is wrong, unsure though.

pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)

Why typing that long if you can simply do:
pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
__________________
Jochemd is offline  
Old 07/01/2011, 03:49 PM   #8
Joe Staff
High-roller
 
Joe Staff's Avatar
 
Join Date: Aug 2007
Posts: 2,567
Reputation: 377
Default Re: Transforming zcmd's commands to regular commands

It's not, he put the IF statement outside of OnPlayerCommandText, I'm guessing.
__________________
Big bottom girls make this rockin' world go 'round.
Joe Staff is offline  
Old 07/01/2011, 03:51 PM   #9
nuriel8833
High-roller
 
nuriel8833's Avatar
 
Join Date: Jun 2009
Location: Israel
Posts: 1,158
Reputation: 16
Default Re: Transforming zcmd's commands to regular commands

With the zcmd's include the FS works perfect,I don't think its something in the script itself,maybe something that we've changed
__________________
Back to forums
Although I am not scripting much,only my gamemode on my free time

My works:
80.179.219.89:7778
[Tutorial] Kills Table BonusLast.fm
nuriel8833 is offline  
Old 07/01/2011, 03:52 PM   #10
HyperZ
High-roller
 
HyperZ's Avatar
 
Join Date: Aug 2009
Posts: 1,340
Reputation: 66
Default Re: Transforming zcmd's commands to regular commands

Quote:
Originally Posted by Jochemd View Post
pawn Code:
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");

I think it's that. Probably that 0x01 is wrong, unsure though.

pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)

Why typing that long if you can simply do:
pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
Im sorry, but
pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)
its not wrong, i guess.
__________________

Last edited by HyperZ; 07/01/2011 at 05:26 PM.
HyperZ is offline  
 

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
[Help] RP commands /me /do dovys11 Scripting Help 12 17/02/2013 01:07 PM
DCMD Commands not working after adding some ZCMD commands :S [L3th4l] Help Archive 4 20/01/2010 09:57 PM
Help with 2 commands ihatetn931 Help Archive 0 11/01/2010 08:15 PM
Commands Geekzor Help Archive 3 15/08/2009 01:58 PM


All times are GMT. The time now is 12:48 AM.


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