PDA

View Full Version : Dialog Help :)


farCry.xD
19/07/2012, 06:12 PM
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 :)

nepstep
19/07/2012, 06:18 PM
What you mean it doesn't work?
You are missing the last bracket btw..

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;
}
}
}

farCry.xD
19/07/2012, 06:30 PM
Is not from the bracket ;) The dialog response doesn't work !

nepstep
19/07/2012, 06:42 PM
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"

farCry.xD
19/07/2012, 06:47 PM
ShowPlayerDialog(playerid,761,DIALOG_STYLE_LIST, ""W"\t\t\tJobs",BigString15,"Close", "");

This :)

XStormiest
19/07/2012, 06:49 PM
read this to learn how to do a dialog
i make this specialy for you

http://forum.sa-mp.com/showthread.php?t=361014

nepstep
19/07/2012, 06:52 PM
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.

farCry.xD
19/07/2012, 06:53 PM
Man , /:) The dialog is : 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;
}

/:)

XStormiest
19/07/2012, 06:56 PM
hmmm

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

farCry.xD
19/07/2012, 07:00 PM
<Solved> Thx all :X

nepstep
19/07/2012, 07:02 PM
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.
http://forum.sa-mp.com/showthread.php?t=57018