How do I duplicate commands in PAWNO? /heal = /hp - 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: How do I duplicate commands in PAWNO? /heal = /hp (
/showthread.php?tid=543969)
How do I duplicate commands in PAWNO? /heal = /hp -
Zion22be - 30.10.2014
For instance, /heal and /hp will be the same thing. I just don't want to copy paste the block of code and replace the user-input command to /hp.
Re: How do I duplicate commands in PAWNO? /heal = /hp -
Quickie - 30.10.2014
what kind of command processor do you use??
ex:
dcmd?
zcmd?
y_commands?
or just the onplayercommand callback
Re: How do I duplicate commands in PAWNO? /heal = /hp -
Banana_Ghost - 30.10.2014
Assuming Heal is the main command:
dcmd:
pawn Код:
dcmd_hp(playerid, params[]) return dcmd_heal(playerid, params);
//Place this under all of your commands with dcmd
zcmd:
pawn Код:
CMD:hp(playerid,params[])
{
return cmd_heal(playerid,params);
}
//I generally place these right under the command itself.
ycmd:
pawn Код:
Command_AddAltNamed("heal", "hp");
//Place This Under OnGamemodeInit
strcmp:
pawn Код:
if((strcmp("/heal", cmdtext, true) == 0) || (strcmp("/hp", cmdtext, true) == 0))
//Use this under OnPlayerCommandText
Re: How do I duplicate commands in PAWNO? /heal = /hp -
Zion22be - 30.10.2014
I just use the default strcmp/onplayercommand stuff lol. I don't like the idea of having to format 2700 lines of code by myself to ZCMD or anything >_<
Re: How do I duplicate commands in PAWNO? /heal = /hp -
Banana_Ghost - 30.10.2014
pawn Код:
if((strcmp("/heal", cmdtext, true) == 0) || (strcmp("/hp", cmdtext, true) == 0))
//Use this under OnPlayerCommandText
use this then
Re: How do I duplicate commands in PAWNO? /heal = /hp -
Zion22be - 30.10.2014
Quote:
Originally Posted by Banana_Ghost
pawn Код:
if((strcmp("/heal", cmdtext, true) == 0) || (strcmp("/hp", cmdtext, true) == 0)) //Use this under OnPlayerCommandText
use this then
|
Thank you!
Re: How do I duplicate commands in PAWNO? /heal = /hp -
Banana_Ghost - 30.10.2014
You're most certainly welcome!