Return another command - 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: Return another command (
/showthread.php?tid=543660)
Return another command -
MrSnapp - 28.10.2014
Hi all. I want to shorten the shout command as follows via YCMD. What is wrong with this code as I get error undefined symbol "cmd_shout". Is YCMD able to even do it?
pawn Код:
YCMD:s(playerid,params[], help)
{
return cmd_shout(playerid,params);
}
pawn Код:
YCMD:shout(playerid, params[], help)
{
new string[128], shout[100];
if(sscanf(params,"s[100]",shout))return SendClientMessage(playerid,-1,"USAGE: /(s)hout [message]");
else
{
format(string, sizeof(string), "%s shouts: %s!",GetName(playerid),shout);
ProxDetector(50.0, playerid, string, -1);
}
return 1;
}
Any help appreciated.
EDIT: fixed a bracket
Re: Return another command -
Quickie - 28.10.2014
u cant do that in y_commands u can do this instead
pawn Код:
public OnGameModeEnit() //or somewhere else
{
Command_AddAltNamed("shout","s");
}
also check
https://sampforum.blast.hk/showthread.php?tid=169029
Quote:
Command_AddAlt(oldid, altname[]) - Adds an alternate spelling for a command by ID.
Command_AddAltNamed(old[], altname[]) - Adds an alternate spelling for a command by name.
|
Re: Return another command -
MrSnapp - 28.10.2014
Thanks mate, thought it was y_commands!