Posts: 195
Threads: 19
Joined: Apr 2011
17.08.2011, 20:36
(
Последний раз редактировалось ElieJabbour; 17.08.2011 в 21:21.
)
Example :
pawn Код:
command(gotoint, playerid, params[])
{
new Interior, Float: X, Float: Y, Float: Z;
if( sscanf( params, "dfff", Interior, X, Y, Z ) )
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
SendClientMessage( playerid, COLOR_SYN, "[Syntax:]{FFFFFF} /gotoint [Interior ID] [x point] [y point] [z point]" );
}
}
else
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
SetPlayerPos( playerid, X, Y, Z );
SetPlayerInterior( playerid, Interior );
SendClientMessage( playerid, COLOR_SMSG, "[Server:]{FFFFFF} You have been teleported to the defined position." );
}
}
return 1;
}
Haven't tried it before..
Posts: 925
Threads: 36
Joined: Dec 2009
Reputation:
0
Yes. It's STRCMP not STRPCMD but nevermind. You need strtok also.
Posts: 2,857
Threads: 62
Joined: Dec 2010
Reputation:
0
Are you mad? Why would you do that?
Posts: 195
Threads: 19
Joined: Apr 2011
Quote:
Originally Posted by Berlovan
Yes. It's STRCMP not STRPCMD but nevermind. You need strtok also.
|
I Know what it is, Check out my keyboard.
Quote:
Originally Posted by linuxthefish
Are you mad? Why would you do that?
|
Dude, What do you care ? I wanna Convert some shits to strcmd -.-
Posts: 195
Threads: 19
Joined: Apr 2011
Quote:
Originally Posted by Kush
He's claiming he doesn't use a Godfather edit, he's using "his scratch server". So it apparently seems like he's found that code some-where and want to implement it into 'his script'.
|
(( Soz for double post ))
Yep, I took this code from a godfather edit, and my script is strcmd, now stop spamming my thread if you don't wanna help, Tyvm
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
It is not "strcmd" it's "strcmp."
Why the hell would you want to change from ZCMD? You should be changing to ZCMD!
Posts: 195
Threads: 19
Joined: Apr 2011
Quote:
Originally Posted by RealCop228
It is not "strcmd" it's "strcmp."
Why the hell would you want to change from ZCMD? You should be changing to ZCMD!
|
Won't it be hard or take some time to change the whole script from strcmp to zcmd ?:/
Posts: 195
Threads: 19
Joined: Apr 2011
Quote:
Originally Posted by Kush
I've never understood strcmp for use as a function to return commands and probably never will. If your using a gamemode (presumably Godfather), change to Vortex 2. You will not only learn, but see how efficient and easy scripting is.
|
I know its Easy, and mine isn't a Godfather edit, i used strcmp and i needed the /gotoint cmd from another edit, and its zcmd, so i needed to convert it.
Posts: 195
Threads: 19
Joined: Apr 2011
Quote:
Originally Posted by RealCop228
You don't need to be a genius to change the command processor for some commands. Once you learn how to use sscanf then it should be very easy to change your strcmp commands to ZCMD. It would be pointless to change command processors and use the same functions, such as strtok.
|
Dude, I got it, But the thing is its gonna take me some time to change every command, 1000+ cmds to zcmd, and Cntrl+H won't even help aswell..
Posts: 925
Threads: 36
Joined: Dec 2009
Reputation:
0
ZCMD is faster, better than STRCMP ... It is worth the time. You should change from STRCMP to ZCMD. Trust me, You don't need a lot of changes.
Posts: 195
Threads: 19
Joined: Apr 2011
Aight Mates, Thank you
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
I doubt you have 1000 plus commands. You are probably at a few hundred maximum.