SA-MP Forums Archive
two / in a cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: two / in a cmd (/showthread.php?tid=519348)



two / in a cmd - youssefehab500 - 13.06.2014

Hey guys I think its a crazy Q but here we go xD I found alot of servers who use zcmd and made sth that idk to enable that some cmds like for ex aa they made it to be //aa not /aa and they have both like some cmds use only one / and some use // how to do this I thought of sth in the cmd I thought of doing CMD:/aa (playerid, params []) but got an error so how to do it


Re: two / in a cmd - SickAttack - 13.06.2014

You have to do it with OnPlayerText.


Re: two / in a cmd - youssefehab500 - 13.06.2014

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
You have to do it with OnPlayerText.
Ahhh okay thnx buddy another small Q can I use zcmd and make normal cmds using onplayertext or wont work bec onplayertext doesbt work with zmcd got replaced with onplayercommandperformed and received? Srry for asking alot


Re: two / in a cmd - SickAttack - 13.06.2014

Here's an example:
pawn Код:
new cmd[128], params[128];
sscanf(text, "s[128]s[128]", cmd, params);
if(!strcmp(cmd, "//aa", true)) {cmd_aa(playerid, params); return 0;}
Note that you will need sscanf.
You can get it here: https://sampforum.blast.hk/showthread.php?tid=120356.


Re: two / in a cmd - youssefehab500 - 13.06.2014

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Here's an example:
pawn Код:
new cmd[128], params[128];
sscanf(text, "s[128]s[128]", cmd, params);
if(!strcmp(cmd, "//aa", true)) {cmd_aa(playerid, params); return 0;}
Note that you will need sscanf.
You can get it here: https://sampforum.blast.hk/showthread.php?tid=120356.
Ok thanks man I rly appreciate it and I Rep+ u for ur help


Respuesta: two / in a cmd - Shura - 14.06.2014

Код HTML:
CMD:aa(playerid, params[])
{
Function code
}
I hope you serve


Re: Respuesta: two / in a cmd - youssefehab500 - 14.06.2014

Quote:
Originally Posted by Shura
Посмотреть сообщение
Код HTML:
CMD:aa(playerid, params[])
{
Function code
}
I hope you serve
Yes to make the one under onplayertext hss same functionality as the other one thanks bro
If you have skype feel free to add me youssefehab100


Respuesta: two / in a cmd - Shura - 14.06.2014

Sorry, I just do not understand so well, I thought you wanted to convert ZCMD in CMD, excuse my language.


Re: Respuesta: two / in a cmd - youssefehab500 - 14.06.2014

Quote:
Originally Posted by Shura
Посмотреть сообщение
Sorry, I just do not understand so well, I thought you wanted to convert ZCMD in CMD, excuse my language.
No I just wanted to make some cmds like //aa not /aa u get me ?


Respuesta: two / in a cmd - Shura - 14.06.2014

You refer to a command with two dividers? O.o ("//") ?