SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 08/03/2012, 03:09 PM   #21
Ricop522
High-roller
 
Ricop522's Avatar
 
Join Date: Feb 2010
Location: ES
Posts: 2,697
Reputation: 148
Default Re: rCmd.inc - Easiest way to create commands!

Great job!
__________________
"Any fool can write code that a
computer can understand. Good
programmers write code that
humans can understand."

Sistemas de Informação, IFES
Ricop522 is offline   Reply With Quote
Old 09/03/2012, 09:04 PM   #22
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 3,134
Reputation: 636
Default Re: rCmd.inc - Easiest way to create commands!

Quote:
Originally Posted by YJIET View Post
I think this would be way better if you combined it with sscanf to support optional parameters, arrays etc.
Sorry, just noticed this post and I'm not sure what you mean. Can you explain a bit different please?

Beside this, are there any suggestions? I'd like to improve this command system.
__________________

Sup?
RyDeR` is offline   Reply With Quote
Old 09/03/2012, 09:23 PM   #23
TheArcher
High-roller
 
TheArcher's Avatar
 
Join Date: Dec 2009
Location: Home
Posts: 2,487
Reputation: 227
Default Re: rCmd.inc - Easiest way to create commands!

Well it's nice to see more ideas around the forums but anyways i bet the people will keep using ZCMD due to its performance and not for options. Good job though.
__________________
TheArcher is offline   Reply With Quote
Old 09/03/2012, 10:08 PM   #24
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 3,134
Reputation: 636
Default Re: rCmd.inc - Easiest way to create commands!

I personally don't think that's the main reason. It's just because zcmd exists for quite a long time now and many people are used to it due its easiness combined with sscanf (plugin). Also many gamemodes are using zcmd nowdays and I don't think they'll just switch over just to make stuff easier, but I'm pretty sure that this will become very handy for people that create new gamemodes.
__________________

Sup?
RyDeR` is offline   Reply With Quote
Old 09/03/2012, 11:30 PM   #25
Stylock
Huge Clucker
 
Stylock's Avatar
 
Join Date: Dec 2010
Posts: 342
Reputation: 137
Default Re: rCmd.inc - Easiest way to create commands!

I meant that you should include sscanf so it would be possible to use optional params and other stuff:
pawn Code:
public OnGameModeInit()
{
    rCmd_Init(car, "iI(-1)I(-1)");
}

rCmd:car(playerid, success, iModel, iColor1, iColor2)
{
    //code
    return 1;
}
Not sure if it's implementable though.
Stylock is offline   Reply With Quote
Old 10/03/2012, 08:32 AM   #26
lackos888
Little Clucker
 
Join Date: Jan 2012
Posts: 17
Reputation: 0
Default Re: rCmd.inc - Easiest way to create commands!

This command processor is like in MTA Lowe it!
lackos888 is offline   Reply With Quote
Old 09/04/2012, 03:33 PM   #27
vpontin
Little Clucker
 
vpontin's Avatar
 
Join Date: Dec 2010
Location: Someplace...
Posts: 23
Reputation: 0
Question Re: rCmd.inc - Easiest way to create commands!

Question: How do I call a command from another in the script?
For example, for dcmd I use:
PHP Code:
dcmd_help(playeridparams[]) // Alias of /commands
{        
    return 
dcmd_commands(playerid,params);

__________________












Sorry my bad English, I still do not have 100% fluence over it...


Last edited by vpontin; 09/04/2012 at 03:35 PM. Reason: Grammar (Poor Google Translate)
vpontin is offline   Reply With Quote
Old 10/04/2012, 10:20 PM   #28
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 3,134
Reputation: 636
Default Re: rCmd.inc - Easiest way to create commands!

@YJIET:
Not sure about sscanf, but it is possible to add some specifiers in the command processor itself.

@vpontin:
For example:
pawn Code:
rCmd_Init(addcar,   "iffffii"); // Init

rCmd:addcar(playerid, success, iModel, Float: fX, Float: fY, Float: fZ, Float: fA, iColor1, iColor2) {
    if(!success)
        return SendClientMessage(playerid, 0xFF0000FF, "<> Syntax: /addcar [model] [x] [y] [z] [angle] [color1] [color2]");
    if(!(400 <= iModel <= 611))
        return SendClientMessage(playerid, 0xFF0000FF, "<> Error: Invalid model. Need to be between 400 and 611!");
   
    CreateVehicle(iModel, fX, fY, fZ, fA, iColor1, iColor2, 60);
   
    SendClientMessage(playerid, 0x00FF00FF, "<> You succesfully created the vehicle!");
    return 1;
}
Will be like:
pawn Code:
rCmd_Init(createveh,   "iffffii"); // Init

rCmd:createveh(playerid, success, iModel, Float: fX, Float: fY, Float: fZ, Float: fA, iColor1, iColor2) {
    return cmd_addcar(playerid, success, iModel, Float: fX, Float: fY, Float: fZ, Float: fA, iColor1, iColor2);
}
__________________

Sup?
RyDeR` is offline   Reply With Quote
Old 10/04/2012, 10:36 PM   #29
DonWade
Huge Clucker
 
DonWade's Avatar
 
Join Date: Nov 2011
Location: Bosna i Hercegovina || ZENICA 032 ||
Posts: 204
Reputation: 17
Default Re: rCmd.inc - Easiest way to create commands!

Really Nice.

Is it possible to post speedtest of this cmd processor compareing it with ZCMD or YCMD


EDIT: You already did
__________________
DonWade is offline   Reply With Quote
Old 10/04/2012, 10:49 PM   #30
Juninho_Oakley
Gangsta
 
Juninho_Oakley's Avatar
 
Join Date: Aug 2011
Location: Fim do Mundo
Posts: 534
Reputation: 25
Default Re: rCmd.inc - Easiest way to create commands!

Good Job Ryder
__________________
Favorite Games





Graphic Card


User

Juninho_Oakley 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
[FilterScript] [FS] IntroZones - The Easiest way to create gang zones. Version 1.0 introzen Filterscripts 64 15/09/2012 01:21 PM
How to create more commands in one fs wumpyc Scripting Help 9 29/09/2011 01:57 PM
How to create commands /myrank Noredine Help Archive 31 25/03/2010 10:13 AM
rcmd, like dcmd but for rcon commands! Daren_Jacobson Help Archive 4 02/03/2009 10:02 PM


All times are GMT. The time now is 04:58 PM.


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