Dialog to Callbacks? Comeon anyone?
#9

pawn Код:
#define DIALOG_ZCLASS 1
#define DIALOG_VCLASS 2

command(Class,playerid,params[])
{
    if(gTeam[playerid] == Zombie)
    {
        ShowPlayerDialog(playerid, DIALOG_ZCLASS, DIALOG_STYLE_LIST, "Class Selection", "{FF0000}Bite(30HP)\n{00FF00}High Jump", "Select", "Cancle");
    }
    else if(gTeam[playerid] == Vampire)
    {
        ShowPlayerDialog(playerid, DIALOG_VCLASS, DIALOG_STYLE_LIST, "Class Selection", "{FF0000}Bite (30HP)\n{00FF00}Tp to nearest player", "Select", "Cancle");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
    case DIALOG_ZCLASS :
    {
        if(!response) return ShowPlayerDialog(playerid,-1,0,"","","","");
        if(response)
        {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:
                {

                        new id =  GetClosestPlayerToPlayer(playerid);
                        new Float:x,Float:y,Float:z;
                        GetPlayerPos(id,x,y,z);
                        SetPlayerPos(playerid,x,z,z);

                }
                case 1:
                {
                    //Whatever you want in case 1
                }
            }
        }
    }
    }
    return 1;
}
pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
I checked this code , works fine.
Reply


Messages In This Thread
Dialog to Callbacks? Comeon anyone? - by Rudy_ - 20.06.2012, 05:48
Re: Dialog to Callbacks? Comeon anyone? - by Rudy_ - 20.06.2012, 06:10
Re: Dialog to Callbacks? Comeon anyone? - by [MM]RoXoR[FS] - 20.06.2012, 06:28
Re: Dialog to Callbacks? Comeon anyone? - by Rudy_ - 20.06.2012, 06:30
Re : Dialog to Callbacks? Comeon anyone? - by mehdi-jumper - 20.06.2012, 07:11
Re: Dialog to Callbacks? Comeon anyone? - by Rudy_ - 20.06.2012, 07:17
Re: Dialog to Callbacks? Comeon anyone? - by [MM]RoXoR[FS] - 20.06.2012, 07:31
Re: Dialog to Callbacks? Comeon anyone? - by Rudy_ - 20.06.2012, 07:34
Re: Dialog to Callbacks? Comeon anyone? - by [MM]RoXoR[FS] - 20.06.2012, 07:43
Re: Dialog to Callbacks? Comeon anyone? - by Rudy_ - 20.06.2012, 08:03

Forum Jump:


Users browsing this thread: 4 Guest(s)