SA-MP Forums Archive
[HELP] Possible? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Possible? (/showthread.php?tid=197985)



[HELP] Possible? - Larsey123IsMe - 10.12.2010

Is it possible to make it when i type /commands, then the dialog with commands come up, then i click on "call after food delivery" then i want it to type /food

like i just type(ingame): t/food

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/commands", true))
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Thing!", "Call after food delivery", "call", "Cancel");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
                {
                //Food Delivery-------------------------------------------------
                    case 0:
                    {
                        SendClientCommand(playerid, "/food"); //something like that =/... i just guessed
                    }
                //--------------------------------------------------------------
                }
            }
       }
   }
return 1;
}



Re: [HELP] Possible? - iFriSki - 10.12.2010

Suggest looking into DCMD or ZCMD. Believe you could make a direct call to the function then. Not to mention, it's a whole lot faster.


Re: [HELP] Possible? - Sergei - 10.12.2010

Simple as this:
Код:
CallLocalFunction("OnPlayerCommandText","is",playerid,"/food");



Re: [HELP] Possible? - Larsey123IsMe - 10.12.2010

Quote:
Originally Posted by Sergei
Посмотреть сообщение
Simple as this:
Код:
CallLocalFunction("OnPlayerCommandText","is",playerid,"/food");
LoL thanks :P


Re: [HELP] Possible? - Larsey123IsMe - 10.12.2010

Quote:
Originally Posted by Sergei
Посмотреть сообщение
Simple as this:
Код:
CallLocalFunction("OnPlayerCommandText","is",playerid,"/food");
or... It dident work nothing show up =/