19.09.2011, 13:26
hi all i have my rescue filterscript but when i type /rescue the dialog comes up but says unknown command but it all works as it should
here is code .. please help
here is code .. please help
pawn Код:
#include <a_samp>
#include <sscanf2>
#define PoliceRescueDialog 13340
#define TruckersRescueDialog 13341
#define AssistanceRescueDialog 13342
#define BusRescueDialog 13343
#define CabbieRescueDialog 13344
#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\r\nSFPD","Rescue","Cancel");
}
case 2:
{
ShowPlayerDialog(playerid,TruckersRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","Lv Truck Depot\r\nLs Truck Depot\r\nRock Shore Depot\r\nWillowfield Depot\r\nSF Truck Depot\r\nRS Haul","Rescue","Cancel");
}
case 3:
{
ShowPlayerDialog(playerid,AssistanceRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","BlueBerry Garage\r\nRock Shore Depot\r\nSF Truck Depot","Rescue","Cancel");
}
case 4:
{
ShowPlayerDialog(playerid,BusRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","LV Bus Terminal\r\nLS Bus Depot","Rescue","Cancel");
}
case 5:
{
ShowPlayerDialog(playerid,CabbieRescueDialog,DIALOG_STYLE_LIST,"Choose rescue point","LV Cab Office\r\nLS Cab Office\r\nSF Cab Office","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,0x0000ffFF,"You have been rescued to LVPD HQ");
SendClientMessage(playerid,0x0000ffFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,-1593.7865,716.6462,-5.2422);
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 == CabbieRescueDialog)
{
switch(listitem)
{
case 0:
{
SetPlayerPos(playerid,1046.0646,1305.6222,11.0412);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFF33CCFF,"You have been rescued to LV Cab Office");
SendClientMessage(playerid,0xFF33CCFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,1957.7957,-2214.2544,16.1250);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFF33CCFF,"You have been rescued to LS Cab Office");
SendClientMessage(playerid,0xFF33CCFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 2:
{
SetPlayerPos(playerid,-2026.9294,-101.5480,35.1641);
SetPlayerFacingAngle(playerid,347.8133);
SendClientMessage(playerid,0xFF33CCFF,"You have been rescued to SF Cab Office");
SendClientMessage(playerid,0xFF33CCFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
}
}
if(dialogid == TruckersRescueDialog)
{
switch(listitem)
{
case 0:
{
SetPlayerPos(playerid,1399.5334,1009.6077,10.9297);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to LV truck depot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,1751.7516,-2057.0149,13.7536);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to Ls 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,0xFFFF00FF,"You have been rescued to Rock Shore Depot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
case 3:
{
SetPlayerPos(playerid,-514.1937,-496.7115,25.5234);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to Willow Field Depot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
case 4:
{
SetPlayerPos(playerid,-2162.4900,-224.4328,36.5156);
SetPlayerFacingAngle(playerid,2.2530);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to SF Truck Depot");
SendClientMessage(playerid,0xFFFF00FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
case 5:
{
SetPlayerPos(playerid,-75.0717,-1136.8739,4.2418);
SetPlayerFacingAngle(playerid,347.2463);
SendClientMessage(playerid,0xFFFF00FF,"You have been rescued to RS Haul");
SendClientMessage(playerid,0xFFFF00FF,"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,0xFF9900FF,"You have been rescued to LV Bus Terminal");
SendClientMessage(playerid,0xFF9900FF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
}
case 1:
{
SetPlayerPos(playerid,1957.7957,-2214.2544,16.1250);
SetPlayerFacingAngle(playerid,96.8919);
SendClientMessage(playerid,0xFF9900FF,"You have been rescued to LS Bus Depot");
SendClientMessage(playerid,0xFF9900FF,"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;
}
case 2:
{
SetPlayerPos(playerid,-2162.4900,-224.4328,36.5156);
SetPlayerFacingAngle(playerid,2.2530);
SendClientMessage(playerid,0x00B82EFF,"You have been rescued to SF Truck Depot");
SendClientMessage(playerid,0x00B82EFF,"Rescue fee: $200");
GivePlayerMoney(playerid, -200);
return 0;
}
}
}
}
return 0;
}