OnDialogResponse
#1

Idk when I pressed ANY OF THEM I'll still in 1place!~
Код:
ShowPlayerDialog(playerid, 70, DIALOG_STYLE_LIST, "Choose an Arena", "1- Deagle Only\n2-Sawn-off + Deagle\n3-Freeroam Arena\n4-Minigun","OK", "");
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid == 70)
    {
        case 
5// Dialog ID 70
        
{
            if(
response)
            {
                switch(
listitem)
                {
                    case 
1:
                    {
                        
SendClientMessage(playeridGrey"You are now In Deagle Arena!");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
GivePlayerWeapon(playerid2410000);
                        
SetPlayerHealth(playerid100);
                        
SetPlayerPos(playerid288.745971,169.350997,1007.171875);
                        
SetPlayerInterior(playerid3);
                    }
                    case 
2:
                    {
                        
SendClientMessage(playeridGrey"You are now in Sawnoff + Deagle Arena!");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
GivePlayerWeapon(playerid2410000);
                        
GivePlayerWeapon(playerid2610000);
                        
SetPlayerHealth(playerid100);
                        
SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);
                        
SetPlayerInterior(playerid18);
                    }
                    case 
3:
                    {
                        
SendClientMessage(playeridGrey"You are now in Freeroam arena!");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
ResetPlayerWeapons(playerid);
                        
SetPlayerHealth(playerid99999999);
                        
SetPlayerPos(playerid, -1465.268676,1557.868286,1052.531250);
                        
SetPlayerInterior(playerid14);
                    }
                    case 
4:
                    {
                        
SendClientMessage(playeridGrey"You are now in Minigun Arena! Your health is now 250%.");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
GivePlayerWeapon(playerid38100000);
                        
SetPlayerHealth(playerid250);
                        
SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
                        
SetPlayerInterior(playerid10);
                    }
                }
            }
        }
    }
    return 
1;

Reply
#2

Hello sir. You can do this

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 70)
    {
                if(
response)
                {
                    if(
listitem == 0)
                    {

                        
SendClientMessage(playeridGrey"You are now In Deagle Arena!");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
GivePlayerWeapon(playerid2410000);
                        
SetPlayerHealth(playerid100);
                        
SetPlayerPos(playerid288.745971,169.350997,1007.171875);
                        
SetPlayerInterior(playerid3);
                    }
                    if(
listitem == 1)
                    {
                        
SendClientMessage(playeridGrey"You are now in Sawnoff + Deagle Arena!");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
GivePlayerWeapon(playerid2410000);
                        
GivePlayerWeapon(playerid2610000);
                        
SetPlayerHealth(playerid100);
                        
SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);
                        
SetPlayerInterior(playerid18);
                    }
                    if(
listitem == 2)
                    {
                        
SendClientMessage(playeridGrey"You are now in Freeroam arena!");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
ResetPlayerWeapons(playerid);
                        
SetPlayerHealth(playerid99999999);
                        
SetPlayerPos(playerid, -1465.268676,1557.868286,1052.531250);
                        
SetPlayerInterior(playerid14);
                    }
                    if(
listitem == 3)
                    {
                        
SendClientMessage(playeridGrey"You are now in Minigun Arena! Your health is now 250%.");
                        
SendClientMessage(playeridYellow"You can change your arena Type: /switcha or (/switcharena)!");
                        
GivePlayerWeapon(playerid38100000);
                        
SetPlayerHealth(playerid250);
                        
SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
                        
SetPlayerInterior(playerid10);
                    }
                }
            }
    return 
1;

Hope it worked!
Reply
#3

Speical Thanks for you @worked!! But I have a problem!! I've created a command like that

PHP код:
CMD:switcharena(playeridparams[])
{
  
ShowPlayerDialog(playerid70DIALOG_STYLE_MSGBOX"CHOOSE ARENA""1- DEAGLE\n\nSawn-off + Deagle\n\nFreeroam\n\nMinigun","GO""");

But when I typed this command and choose an arena its teleport me why?
Reply
#4

Quote:
Originally Posted by Thanks
Посмотреть сообщение
But when I typed this command and choose an arena its teleport me why?
All of the dialog choices have teleports in them.

PHP код:
SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049); 
For example. So they will all teleport you.
Reply
#5

What? But I've creating a codes for it why not worked
Reply
#6

I would help if I would understand what do you mean, you should work on your english a bit.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)