[HELP] dialog enter/exit
#1

Hello I was make dialog entrance in bases and also exit, so when you are close pickup you get dialog and in dialog says for enter click on enter. Know is the probblem I was be with my friend on server and for me everything works fine and exit and enter I get dialog, but for my friend he was first enter. I supose that hee get dialog, and know when he was near exit pickup he should get dialog but he says that he doens't get dialog. What cause this problem.

This is creating pickups on ongamemodeinit

pawn Код:
fbienter = CreatePickup(1239,1,914.4413,-1004.5359,37.9813);
    fbiexit = CreatePickup(1239,1,288.7802,166.9836,1007.1719,5);
and here in public onplayerpickuppickup is those two dialogs:


pawn Код:
else if(pickupid == fbienter)
    {
            new mesage1[1148];
            new dialog[1148];
            format(mesage1,sizeof(mesage1),"{FFFFFF}FBI Enter\n\n{FFFFFF}Click {00C0FF}Enter {FFFFFF}to enter the base or {F3FF02}Quit{FFFFFF}!");
            format(dialog,713,"%s",mesage1);
            ShowPlayerDialog(playerid,115,DIALOG_STYLE_MSGBOX,"{00C0FF}Enter",dialog,"Enter","Quit");
    }
and here is for exit


pawn Код:
else if(pickupid == fbiexit)
    {
            new mesage1[1148];
            new dialog[1148];
            format(mesage1,sizeof(mesage1),"{FFFFFF}FBI Exit\n\n{FFFFFF}Click {00C0FF}Exit {FFFFFF}or {F3FF02}Quit {FFFFFF}!");
            format(dialog,713,"%s",mesage1);
            ShowPlayerDialog(playerid,116,DIALOG_STYLE_MSGBOX,"{00C0FF}Exit",dialog,"Exit","Quit");
    }
Reply
#2

I edited that a bit..
pawn Код:
else if(pickupid == fbienter)
{
    new mesage1[1148];
    format(mesage1,sizeof(mesage1),"{FFFFFF}FBI Enter\n\n{FFFFFF}Click {00C0FF}Enter {FFFFFF}to enter the base or {F3FF02}Quit{FFFFFF}!");
    ShowPlayerDialog(playerid,115,DIALOG_STYLE_MSGBOX,"{00C0FF}Enter",mesage1,"Enter","Quit");
}
else if(pickupid == fbiexit)
{
    new mesage1[1148];
    format(mesage1,sizeof(mesage1),"{FFFFFF}FBI Exit\n\n{FFFFFF}Click {00C0FF}Exit {FFFFFF}or {F3FF02}Quit {FFFFFF}!");
    ShowPlayerDialog(playerid,116,DIALOG_STYLE_MSGBOX,"{00C0FF}Exit",mesage1,"Exit","Quit");
}
Can you show "OnDialogResponse" id '115' and '116' ?
Reply
#3

pawn Код:
if(dialogid == 115)
    {
        if(response)
        {
            if(PlayerInfo[playerid][Member] == 2 || PlayerInfo[playerid][Leader] == 2)
            {
                SetPlayerInterior(playerid,3);
                SetPlayerPos(playerid,288.7802,166.9836,1007.1719);
                SetPlayerVirtualWorld(playerid,5);
            }
            else
            {
                GameTextForPlayer(playerid,"~r~locked!",5000,1);
            }
        }
    }
and here is 116

pawn Код:
if(dialogid == 116)
    {
        if(response)
        {
            SetPlayerInterior(playerid,0);
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerPos(playerid,914.4413,-1004.5359,37.9813);
        }
    }
Reply
#4

It shall be working fine, Maybe your friend was lagging or something, Try it yourself or ask a friend to do it again for you.

Also I noticed something, You're using pretty large vars for strings.

You could either not to use a string in that case and put the sentience directly like this
pawn Код:
ShowPlayerDialog(playerid,115,DIALOG_STYLE_MSGBOX,"{00C0FF}Enter","{FFFFFF}FBI Enter\n\n{FFFFFF}Click {00C0FF}Enter {FFFFFF}to enter the base or {F3FF02}Quit{FFFFFF}!","Enter","Quit");
or
pawn Код:
new mesage1[] = "{FFFFFF}FBI Enter\n\n{FFFFFF}Click {00C0FF}Enter {FFFFFF}to enter the base or {F3FF02}Quit{FFFFFF}!";
ShowPlayerDialog(playerid,115,DIALOG_STYLE_MSGBOX,"{00C0FF}Enter",mesage1,"Enter","Quit");
Reply
#5

can you maybe tell one more thing how can I make for example know when I enter in the base I get wright here dialog for exit if you know what I mean. My question is how can I make when I enter in the base I wait for five seconds and then I get dialog for exit. Thanks
Reply
#6

Quote:
Originally Posted by Luca12
Посмотреть сообщение
how can I make when I enter in the base I wait for five seconds and then I get dialog for exit. Thanks
Use a timer

Example:
pawn Код:
if(dialogid == 115)
    {
        if(response)
        {
            if(PlayerInfo[playerid][Member] == 2 || PlayerInfo[playerid][Leader] == 2)
            {
                SetPlayerInterior(playerid,3);
                SetPlayerPos(playerid,288.7802,166.9836,1007.1719);
                SetPlayerVirtualWorld(playerid,5);
               
                SetTimerEx("DoYouWannaLeave", 5*1000/*5 seconds*/, false", "i", playerid);
            }
            else
            {
                GameTextForPlayer(playerid,"
~r~locked!",5000,1);
            }
        }
    }
   
forward DoYouWannaLeave(playerid);
public DoYouWannaLeave(player)
{
    ShowPlayerDialog(playerid,116,DIALOG_STYLE_MSGBOX,"
{00C0FF}Exit","{FFFFFF}FBI Exit\n\n{FFFFFF}Click {00C0FF}Exit {FFFFFF}or {F3FF02}Quit {FFFFFF}!","Exit","Quit");
    return 1;
}
Reply
#7

Just this, how can in this dialog put if I near closest house then in dialog show me level and price. Thanks

ShowPlayerDialog(playerid,115,DIALOG_STYLE_MSGBOX, "{00C0FF}Enter","{FFFFFF}FBI Enter\n\n{FFFFFF}Click {00C0FF}Enter {FFFFFF}to enter the base or {F3FF02}Quit{FFFFFF}!","Enter","Quit");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)