01.07.2013, 02:51
I've tried almost everything to try to get a response from this script from a list dialog, with no luck. Is there a problem with my script, or is this a bug?
Код:
//Bait-Car prototype #define FILTERSCRIPT #include <a_samp> new BC1; new BC2; new BC3; new BC4; new BC5; new BC6; #define DIALOG_BCLIST 750 public OnVehicleDeath(vehicleid, killerid) { DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(IsPlayerAdmin(playerid)) { if (strcmp("/BC", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Commands: Huntley = /BC1 | Turismo = /BC2 | Sultan = /BC3"); SendClientMessage(playerid, 0x00FFFFFF, "Commands: Buffalo = /BC4 | Patriot = /BC5 | Jetmax (boat) = /BC6 "); SendClientMessage(playerid, 0x00FFFFFF, "Commands: /DIS -Disable the Bait-Car's motor, bringing the car to a stop."); return 1; } if (!strcmp("/BCL", cmdtext, true)) { ShowPlayerDialog(playerid,750, DIALOG_STYLE_LIST, "Available Bait-Cars", "Huntley", "Select", "Cancel"); return 1; } //I want all this info to be put into the dialog, but I only need the first one fixed as a demo /*if (strcmp("/BC1", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 1 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid,x,y,z); BC1=CreateVehicle(579, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC1, 0); return 1; } if (strcmp("/BC2", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 2 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid,x,y,z); BC2=CreateVehicle(451, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC2, 0); return 1; } if (strcmp("/BC3", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 3 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); BC3=CreateVehicle(560, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC3, 0); return 1; } if (strcmp("/BC4", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 4 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); BC4=CreateVehicle(402, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC4, 0); return 1; } if (strcmp("/BC5", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 5 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); BC5=CreateVehicle(470, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC5, 0); return 1; } if (strcmp("/BC6", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 6 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); BC6=CreateVehicle(493, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC6, 0); return 1; } if (strcmp("/DIS", cmdtext, true)==0) { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car Disabled."); SetVehicleParamsEx(BC1, 0, 1, 0, 1, 0, 0, 0); SetVehicleParamsEx(BC2, 0, 1, 0, 1, 0, 0, 0); SetVehicleParamsEx(BC3, 0, 1, 0, 1, 0, 0, 0); SetVehicleParamsEx(BC4, 0, 1, 0, 1, 0, 0, 0); SetVehicleParamsEx(BC5, 0, 1, 0, 1, 0, 0, 0); SetVehicleParamsEx(BC6, 0, 1, 0, 1, 0, 0, 0); return 1; }*/ } else { SendClientMessage(playerid, 0x00FFFF, "You must be an admin/police."); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_BCLIST) { if(response) { switch(listitem) { case 0: { SendClientMessage(playerid, 0x00FFFFFF, "Bait-Car 1 Initiated, find a spot to park it."); DestroyVehicle(BC1); DestroyVehicle(BC2); DestroyVehicle(BC3); DestroyVehicle(BC4); DestroyVehicle(BC5); DestroyVehicle(BC6); new Float:x,Float:y,Float:z,Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid,x,y,z); BC1=CreateVehicle(579, x, y, z,a, -1, -1, -1); PutPlayerInVehicle(playerid, BC1, 0); return 1; } } } } return 0; }