Forwarding a Command?
#1

how to forward a acommand i mean
i made a help pickup?
how can i forward it to /help cmd?
when ever someones picks the Pickup
it should forward the whole /help command?
Reply
#2

Make it into a function/stock and just use it when needed!
Reply
#3

o.O Ohk Thnx
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)