Dialog Help :)
#1

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
Reply
#2

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;
            }
        }
    }
Reply
#3

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

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"
Reply
#5

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

read this to learn how to do a dialog
i make this specialy for you
Reply
#7

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.
Reply
#8

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
Reply
#9

<Solved> Thx all :X
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)