Dialog Help
#1

hello guys i tried to fix a Dialog for a friend but it dont work right its not teleporting you to the Position You Select

Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/Police_Rescue", cmdtext, true, 7))
	{
       ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Choose rescue point","LVPD\nSFPD","Rescue","Cancel");
       return 1;
	}
    if(!strcmp("/Trucker_Rescue", cmdtext, true, 7))
	{
       ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Choose rescue point","LV TRUCK\nWillowfield\nRock Shore Depot","Rescue","Cancel");
       return 1;
	}
    if(!strcmp("/Assistance_Rescue", cmdtext, true, 7))
	{
       ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Choose rescue point","BlueBerry Garage\nRock Shore Depot","Rescue","Cancel");
       return 1;
	}
    if(!strcmp("/Bus_Rescue", cmdtext, true, 7))
	{
       ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Choose rescue point","LS Bus Depot\nLV Bus Terminal","Rescue","Cancel");
       return 1;
	}
	return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(dialogid)
        {
        case 2:
            {
            switch(listitem)
            {
                case 0: //Add another 'case' but with +1 id and change the cords/name
                {
                    SetPlayerPos(playerid,2296.7986,2450.9976,10.8203);
                    SetPlayerFacingAngle(playerid,94.1423);
                    SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to LVPD HQ");
                    SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
                    GivePlayerMoney(playerid, -200);
                }
                case 1:
                {
                    SetPlayerPos(playerid,2296.79885674216534165326,2450.9976,10.8203);
                    SetPlayerFacingAngle(playerid,94.1423);
                    SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to SFPD HQ");
                    SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
                    GivePlayerMoney(playerid, -200);
                }

            }
        }
        case 3:
        {
            switch(listitem)
       case 5:
        {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerPos(playerid,56.0339,-186.9275,1.8145);
                    SetPlayerFacingAngle(playerid,96.8919);
                    SendClientMessage(playerid,0x00B82EFF,"You have been rescued to BlueBerry Garage");
                    SendClientMessage(playerid,0x00B82EFF,"Rescue fee: $200");
                    GivePlayerMoney(playerid, -200);
                 }
                 case 1:
                {
                    SetPlayerPos(playerid,2817.3284,972.9627,10.7500);
                    SetPlayerFacingAngle(playerid,96.8919);
                    SendClientMessage(playerid,0x00B82EFF,"You have been rescued to Rock Shore Depot");
                    SendClientMessage(playerid,0x00B82EFF,"Rescue fee: $200");
                    GivePlayerMoney(playerid, -200);
                    }
				}
			}
		}
	}
return 0;
}
^
|
|
|
|

The Code

Please Help Me

regards,

Zonoya

[NOTE: the Dialog ids are 2, 3, 4 and 5 Because i have a dialog with ID 1]
Reply
#2

Reutrn 1 in every dialogid but return 0 at the end on OnDialogResponse.
pawn Код:
if(dialogid == 123123)
{
    dsfgs
    asdasd
    asdasd
    return 1;
}
return 0;
Reply
#3

One question, why is there a Case 2 under switch(dialogid) ?

And it should be

PHP код:
switch(dialogid)
{
   case 
1:
   {
      if(!
response)
       { 
Reply
#4

this isn't my script its [LHT]Bally's Script im tryin to fix it
Reply
#5

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
One question, why is there a Case 2 under switch(dialogid) ?

And it should be

PHP код:
switch(dialogid)
{
   case 
1:
   {
      if(!
response)
       { 
That's because the dialogid start from 2. And it's (response) = left button.
Reply
#6

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
That's because the dialogid start from 2. And it's (response) = left button.
its not that its because i have another Dialog In the ID 1 place

This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
Reply
#7

https://sampwiki.blast.hk/wiki/OnDialogResponse

Look at the first example, and you'll know what you're missing.
Reply
#8

no i dont know xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)