Forwarding a Command?
#4

Or again, you can try using something like the following:

ZCMD
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == helppickup) //Obviously, helppickup stands for the pickup you mentioned
    {
        cmd_help(playerid, ""); //This will execute the /help command for 'playerid' with no parameters.
    }
    return 1;
}

CMD:help(playerid, params[])
{
    //stuff here
    return 1;
}
STRCMP
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == helppickup)
    {
        OnPlayerCommandText(playerid, "/help");
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/help", true) == 0)
    {
        //stuff here
        return 1;
    }
    return 0;
}
Hope this kind of helps.
Reply


Messages In This Thread
Forwarding a Command? - by Sulps - 09.06.2013, 06:49
Re: Forwarding a Command? - by park4bmx - 09.06.2013, 07:28
Re: Forwarding a Command? - by Sulps - 09.06.2013, 07:57
Re: Forwarding a Command? - by Threshold - 09.06.2013, 08:38

Forum Jump:


Users browsing this thread: 1 Guest(s)