SA-MP Forums Archive
Dialog Help :) - 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)
+--- Thread: Dialog Help :) (/showthread.php?tid=361010)



Dialog Help :) - farCry.xD - 19.07.2012

Hey I maked this dialog response :
Код:
    if(dialogid == 761) 
    {
		if(response)
        {
         if ( listitem == 0)
         {
				new State;
			    State = GetPlayerState(playerid);
			    if(DMZone[playerid] == 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM!");
			    if(IsPlayerInAnyVehicle(playerid))
			    {
			        if(State == PLAYER_STATE_DRIVER)
			        {
			        new vehicleid;
			        vehicleid = GetPlayerVehicleID(playerid);
			        LinkVehicleToInterior(vehicleid, 0);
			        RemovePlayerFromVehicle(playerid);
			        SetVehiclePos(vehicleid, 2099.0176, -1806.1030, 13.5551);
			        }
			    }
			    SetPlayerInterior(playerid, 0);
			    SetPlayerPos(playerid, -2663.3313, 600.9813, 14.4531);
			    SetPlayerFacingAngle(playerid,92.4209);

			    new amb = CreateVehicle(416,-2663.3313, 600.9813, 14.4531,92.4209,-1,-1,600);
			    PutPlayerInVehicle(playerid, amb, 0);
			    Medic[playerid] = 1;
			    new name[MAX_PLAYER_NAME], string[48];
			    GetPlayerName(playerid, name, sizeof(name));
			    format(string, sizeof(string), "* %s is now a Medic.", name );
			    SendClientMessageToAll(COLOR_YELLOW, string);
			    SetPlayerCheckpoint(playerid,-2417.5559,2439.9246,12.6823,10);
			    SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
			    return 1;
			}
		}
But this dialog response doesn't work.
What's the problem ?
Thx


Re: Dialog Help :) - nepstep - 19.07.2012

What you mean it doesn't work?
You are missing the last bracket btw..
pawn Код:
if(dialogid == 761)
    {
        if(response)
        {
            if ( listitem == 0)
            {
                new State;
                State = GetPlayerState(playerid);
                if(DMZone[playerid] == 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM!");
                if(IsPlayerInAnyVehicle(playerid))
                {
                    if(State == PLAYER_STATE_DRIVER)
                    {
                        new vehicleid;
                        vehicleid = GetPlayerVehicleID(playerid);
                        LinkVehicleToInterior(vehicleid, 0);
                        RemovePlayerFromVehicle(playerid);
                        SetVehiclePos(vehicleid, 2099.0176, -1806.1030, 13.5551);
                    }
                }
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, -2663.3313, 600.9813, 14.4531);
                SetPlayerFacingAngle(playerid,92.4209);

                new amb = CreateVehicle(416,-2663.3313, 600.9813, 14.4531,92.4209,-1,-1,600);
                PutPlayerInVehicle(playerid, amb, 0);
                Medic[playerid] = 1;
                new name[MAX_PLAYER_NAME], string[48];
                GetPlayerName(playerid, name, sizeof(name));
                format(string, sizeof(string), "* %s is now a Medic.", name );
                SendClientMessageToAll(COLOR_YELLOW, string);
                SetPlayerCheckpoint(playerid,-2417.5559,2439.9246,12.6823,10);
                SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
                return 1;
            }
        }
    }



Respuesta: Dialog Help :) - farCry.xD - 19.07.2012

Is not from the bracket The dialog response doesn't work !


Re: Respuesta: Dialog Help :) - nepstep - 19.07.2012

Quote:
Originally Posted by farCry.xD
Посмотреть сообщение
Is not from the bracket The dialog response doesn't work !
So you just press at the dialog and it doesn't do what it should do?
Show us the "ShowPlayerDialog"


Respuesta: Dialog Help :) - farCry.xD - 19.07.2012

Код:
ShowPlayerDialog(playerid,761,DIALOG_STYLE_LIST, ""W"\t\t\tJobs",BigString15,"Close", "");
This


Re: Dialog Help :) - XStormiest - 19.07.2012

read this to learn how to do a dialog
i make this specialy for you
Код:
https://sampforum.blast.hk/showthread.php?tid=361014



Re: Respuesta: Dialog Help :) - nepstep - 19.07.2012

Quote:
Originally Posted by farCry.xD
Посмотреть сообщение
Код:
ShowPlayerDialog(playerid,761,DIALOG_STYLE_LIST, ""W"\t\t\tJobs",BigString15,"Close", "");
This
What you want this dialog to be like?
Try something like:
ShowPlayerDialog(playerid,761,DIALOG_STYLE_LIST, "Jobs","Job1\nJob2\Job3,"Okay","Close", "");
Now Job1 will return what you want.


Re: Dialog Help :) - XStormiest - 19.07.2012

hmmm
pawn Код:
dcmd_jobs(playerid,params[]) {
        #pragma unused params
        new BigString15[1900];
        strcat(BigString15, ""R"Medic Job\n", 1900 );
        strcat(BigString15, ""L"Fermier Job!\n", 1900 );
        strcat(BigString15, ""V"PizzaBoy Job\n", 1900 );
        ShowPlayerDialog(playerid,761,DIALOG_STYLE_LIST, "W\t\t\tJobs",BigString15,"Close", "");
        return 1;
    }
try this
and try a small dialog id like 400


Respuesta: Dialog Help :) - farCry.xD - 19.07.2012

<Solved> Thx all :X


Re: Dialog Help :) - nepstep - 19.07.2012

Glad to hear that.

Offtopic: Why the hell you are using a 1900 size string ?
Its so inefficient, I strongly suggest you to read this a code optimization topic.
This one from ****** is by far the best in my opinion.
https://sampforum.blast.hk/showthread.php?tid=57018