Return another command
#1

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
Reply
#2

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.

Reply
#3

Thanks mate, thought it was y_commands!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)