11.09.2011, 12:45
i have had this on here 3 times now lol, and no one has been able to help last shot at it really, the rescue dialog comes up but when i click the button to rescue somewhere it does nothing :S
pawn Код:
#include <a_samp>
#include <sscanf2>
#define PoliceRescueDialog 13340
#define TruckersRescueDialog 13341
#define AssistanceRescueDialog 13342
#define BusRescueDialog 13343
#define LIST DIALOG_STYLE_LIST
new teamid;
public OnPlayerCommandText(playerid, cmdtext[])
{
teamid = GetPlayerTeam(playerid);
new command[130], params[130];
if(sscanf(cmdtext, "s[128]s[128]", command, params) != 0)
{
sscanf(cmdtext, "s[128]", command);
}
if(!strcmp("/rescue", command, true, 7))
{
switch(teamid)
{
case 1: // \r\n Adds a new item to the list
{
ShowPlayerDialog(playerid,PoliceRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","LVPD\nSFPD","Rescue","Cancel");
}
case 2:
{
ShowPlayerDialog(playerid,TruckersRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","LV TRUCK\nWillowfield\nRock Shore Depot","Rescue","Cancel");
}
case 3:
{
ShowPlayerDialog(playerid,AssistanceRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","BlueBerry Garage\nRock Shore Depot","Rescue","Cancel");
}
case 4:
{
ShowPlayerDialog(playerid,BusRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","LS Bus Depot\nLV Bus Terminal","Rescue","Cancel");
}
}
return 0;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response == 1)
{
if(dialogid == PoliceRescueDialog)
{
switch(listitem)
{
case 0: //Add another 'case' but with +1 id and change the cords/name
{
SetPlayerPos(playerid,2296.7986,2450.9976,10.8203);
SetPlayerFacingAngle(playerid,94.1423);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to LVPD HQ");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,2296.79885674216534165326,2450.9976,10.8203);
SetPlayerFacingAngle(playerid,94.1423);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to SFPD HQ");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
}
}
if(dialogid == TruckersRescueDialog)
{
switch(listitem)
{
case 0:
{
SetPlayerPos(playerid,2810.7017,934.2364,10.9766);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to LV truckdepot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,1752.7346,-2054.6328,14.0441);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to Willowfield Truck depot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 2:
{
SetPlayerPos(playerid,2817.3284,972.9627,10.7500,208);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0x00B82EFF,"You have been rescued to Rock Shore Depot");
SendClientMessage(playerid,0x00B82EFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
}
}
if(dialogid == BusRescueDialog)
{
switch(listitem)
{
case 0:
{
SetPlayerPos(playerid,1046.0646,1305.6222,11.0412);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to LV Bus Terminal");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,1957.7957,-2214.2544,16.1250);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to LS Bus Depot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
}
}
if(dialogid == AssistanceRescueDialog)
{
switch(listitem)
{
case 0:
{
SetPlayerPos(playerid,56.0339,-186.9275,1.8145);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0x00B82EFF,"You have been rescued to BlueBerry Garage");
SendClientMessage(playerid,0x00B82EFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
case 1:
{
SetPlayerPos(playerid,2817.3284,972.9627,10.7500,208);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0x00B82EFF,"You have been rescued to Rock Shore Depot");
SendClientMessage(playerid,0x00B82EFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
}
}
}
return 0;
}