07.07.2012, 12:19
You have to add the ShowPlayerDialog under the SetTimer function.
And then use the case's to decide what you wish to happen.
pawn Код:
if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,298.2446, 201.8958, 889.5491))
{
MoveObject(PrisonGate1,296.96875000,207.98828125,892.72052002, 2.2500000);
SetTimer("PrisonGate", 4500, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,295.3155, 211.4049, 889.5491))
{
MoveObject(PrisonGate1, 296.96875000, 207.98828125, 892.72052002, 2.2500000);
SetTimer("PrisonGate", 4500, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,295.3083, 234.5880, 889.5491))
{
MoveObject(PrisonGate2, 299.06845093,231.52783203,888.54907227, 2.2500000);
MoveObject(PrisonGate3, 299.00900269,228.50942993,888.54907227, 2.2500000);
SetTimer("PrisonGate4Opens", 3000, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,299.8243, 227.9879, 889.5491))
{
MoveObject(PrisonGate2, 299.06845093,231.52783203,888.54907227, 2.2500000);
MoveObject(PrisonGate3, 299.00900269,228.50942993,888.54907227, 2.2500000);
SetTimer("PrisonGate4Opens", 3000, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 323.8190, 230.1355, 889.5491))
{
MoveObject(PrisonGate5,318.01525879,231.82656860,891.18591309, 2.500000);
SetTimer("PrisonGate", 4500, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 335.1102, 220.0642, 889.5491))
{
MoveObject(PrisonGate6,335.65136719,222.08398438,892.64837646, 2.500000);
SetTimer("PrisonGateForVisitors", 3500, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 336.2267, 223.9015, 889.5491))
{
MoveObject(PrisonGate6,335.65136719,222.08398438,892.64837646, 2.500000);
SetTimer("PrisonGateForVisitors", 3500, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 320.2110,216.9101,889.5491))//From ENTER PRISON to PRISON
{
SetPlayerPos(playerid, 371.36816,183.34472,889.29827);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 371.36816,183.34472,889.29827))//From PRISON to ENTER PRISON
{
SetPlayerPos(playerid, 320.2110,216.9101,889.5491);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 410.4096,164.0016,895.9006))//Like down ^^
{
SetObjectRot(PrisonGate7,0.00000000,0.00000000,109.99514771);
SetTimer("RotateObjectback", 4000, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 410.2949,165.4837,895.9006))//Upper gates who can open only a police?
{
SetObjectRot(PrisonGate7,0.00000000,0.00000000,109.99514771);
SetTimer("RotateObjectback", 4000, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 369.2244,170.9349,889.5491))//Gates who opens only for police to ISO 1,2
{
MoveObject(PrisonGate8,368.68524170,169.67308044,888.54907227, 2.500000);
SetTimer("InPrisonGate", 3000, false);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 363.3798,155.9887,889.5491))//ISO 2
{
SetPlayerPos(playerid,304.12487793,158.95205688,886.36791992);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 362.9739,153.6197,889.5491))//ISO 1
{
SetPlayerPos(playerid,303.79785156,144.47070312,886.36791992);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 405.8181,181.2119,895.9006))//Open/Close cells dialog
{
ShowPlayerDialog(playerid, 1335, DIALOG_STYLE_LIST, " Please Choose what you want to do...","Open the Cells\nClose the Cells","Ok","Cancel");
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 2.0, 416.7481,159.0282,895.9077))//Gym enter?
{
SetPlayerPos(playerid,409.62695312,96.86425781,896.03515625);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 409.62695312,96.86425781,896.03515625))//GYM exit?
{
SetPlayerPos(playerid,416.7481,159.0282,895.9077);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 5.0, 303.79785156,144.47070312,886.36791992))//From ISO 1 to PRISON
{
SetPlayerPos(playerid,362.9739,153.6197,889.5491);
SetPlayerInterior(playerid, 1);
}
else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 5.0, 304.12487793,158.95205688,886.36791992))//From ISO 2 to PRISON
{
SetPlayerPos(playerid,363.3798,155.9887,889.5491);
SetPlayerInterior(playerid, 1);
}
return 1;
}
pawn Код:
if(dialogid == 1335)
{
if(!response) return SendClientMessage(playerid, COLOR_LIGHTRED, " You Canceled!");
switch(listitem)//wich listitem is chosen
{
case 0://the first item in the list: Open the Gates.
{
// What you wish to happen.
}
case 1://the second item in the list: Close the Gates.
{
// What you wish to happen.
}
}
}
if(dialogid == 1336)