01.06.2014, 12:22
Whenever someone calls for a taxi using /service taxi command it suppose to send the availble taxi drivers that someone is calling for a taxi but it doesn't send a message to accept the call or doesn't even set a checkpoint for him.
So,i was just wondering if someone can help me with it.
Here is the /service [command]
and here is the /service taxi part
Accept Taxi command
Thanks.
So,i was just wondering if someone can help me with it.
Here is the /service [command]
pawn Код:
CMD:service(playerid, params[])
{
new string[128], string2[128], choice[32];
if(sscanf(params, "s[32]", choice))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /service [name]");
SendClientMessageEx(playerid, COLOR_GREY, "Available names: RR, Taxi, Bus, EMS");
return 1;
}
if(PlayerInfo[playerid][pJailed] > 0)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
return 1;
}
if(PlayerInfo[playerid][pServiceTime] > 0) return SendClientMessage(playerid, COLOR_WHITE, "You must wait 30 seconds before using this command again. " );
if(strcmp(choice,"rr",true) == 0)
{
format(string, sizeof(string), "Repair\nRefuel\nTow\nRelease");
ShowPlayerDialog(playerid, DIALOG_CHOOSINGFIX, DIALOG_STYLE_LIST, "{33CCFF}What type of assistance are you requiring?", string, "Select", "Cancel");
SetPVarInt(playerid, "ChoosingFix", 1);
return 1;
}
if(strcmp(choice,"ems",true) == 0)
{
if(GetPVarInt(playerid, "Injured") == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not injured, you can't call for EMS now!");
return 1;
}
new zone[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
SetPVarInt(playerid, "EMSAttempt", 1);
SendClientMessageEx(playerid, COLOR_WHITE, "The EMS have been informed of your current location and are on their way.");
format(string, sizeof(string), "Emergency Dispatch has reported (%d) %s to be wounded at %s, They require immediate emergency transport.",playerid, GetPlayerNameEx(playerid), zone);
format(string2, sizeof(string2), "Type (/getpt %d) to accept this call.",playerid, GetPlayerNameEx(playerid));
SendRadioMessage(4, TEAM_MED_COLOR, string);
SendRadioMessage(17, TEAM_MED_COLOR, string);
SendRadioMessage(20, TEAM_MED_COLOR, string);
SendDivisionMessage(12, 3, TEAM_MED_COLOR, string);
SendRadioMessage(4, TEAM_MED_COLOR, string2);
SendRadioMessage(17, TEAM_MED_COLOR, string2);
SendRadioMessage(20, TEAM_MED_COLOR, string2);
SendDivisionMessage(12, 3, TEAM_MED_COLOR, string2);
foreach(Player, i)
{
if(PlayerInfo[i][pJob] == 23 || PlayerInfo[i][pJob2] == 23)
{
SendClientMessageEx(i, TEAM_MED_COLOR, string);
SendClientMessageEx(i, TEAM_MED_COLOR, string2);
}
}
PlayerInfo[playerid][pServiceTime] = 30;
return 1;
}
else if(strcmp(choice,"taxi",true) == 0)
{
if(TaxiDrivers < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " There are no taxi drivers on duty at the moment, try again later!");
return 1;
}
if(TransportDuty[playerid] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't call for a taxi now!");
return 1;
}
new zone[MAX_ZONE_NAME];
new Float:x, Float:y, Float:z;
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "____________ TAXI DISPATCH PANEL _____________", PlayerInfo[playerid][pPnumber]);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "REQUESTING: {FFFFFF}Taxi Services");
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "DESTINATION: {FFFFFF}%s", zone);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "PHONE NUMBER: {FFFFFF}%i", PlayerInfo[playerid][pPnumber]);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "____________________________________________", PlayerInfo[playerid][pPnumber]);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "To accept this service request; (type /ataxi %d)", playerid);
SendJobMessage(17, COLOR_WHITE, string);
/*format(string, sizeof(string), "** %s is in need of a taxi driver - click Accept to accept the call.", GetPlayerNameEx(playerid));
foreach(Player, i)
{
if(TransportDuty[i] > 0 && (PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17 || PlayerInfo[i][pTaxiLicense] == 1 ))
{
ShowPlayerDialog(i, DIALOG_ACCEPTDIALOG, DIALOG_STYLE_MSGBOX, "{FFFFFF}Taxi Call", string, "Accept", "Reject");
PlayerInfo[i][pAcceptID] =12;
}
}*/
SetPVarInt(playerid, "TaxiCaller", 1);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have called for a taxi driver, wait for a reply.");
TaxiCall = playerid;
PlayerInfo[playerid][pServiceTime] = 30;
return 1;
}
else if(strcmp(choice,"bus",true) == 0)
{
if(BusDrivers < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " There are no bus drivers at the moment, try again later!");
return 1;
}
if(TransportDuty[playerid] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't call for a bus now!");
return 1;
}
format(string, sizeof(string), "** %s is in need of a bus driver - use /accept bus to accept the call.", GetPlayerNameEx(playerid));
foreach(Player, i)
{
if((PlayerInfo[i][pJob] == 14 || PlayerInfo[i][pJob2] == 14) && JobDuty[i] == 1)
{
ShowPlayerDialog(i, DIALOG_ACCEPTDIALOG, DIALOG_STYLE_MSGBOX, "{FFFFFF}Bus Call", string, "Accept", "Reject");
PlayerInfo[i][pAcceptID] =13;
}
}
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have called for a bus driver, wait for a reply.");
BusCall = playerid;
PlayerInfo[playerid][pServiceTime] = 30;
return 1;
}
else if(strcmp(choice,"medic",true) == 0)
{
/*if(Medics < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " There are no medics on duty at the moment, try again later!");
return 1;
}
format(string, sizeof(string), "** %s is in need of a Medic - click Accept to accept the call.", GetPlayerNameEx(playerid));
SendRadioMessage(4, TEAM_AZTECAS_COLOR, string);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have called for a medic, wait for a reply.");
MedicCall = playerid;
PlayerInfo[playerid][pServiceTime] = 30;*/
SendClientMessageEx(playerid, COLOR_GRAD2, " Command no longer used. Use /service ems or /call 911.");
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " Unknown service name!");
return 1;
}
}
pawn Код:
else if(strcmp(choice,"taxi",true) == 0)
{
if(TaxiDrivers < 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " There are no taxi drivers on duty at the moment, try again later!");
return 1;
}
if(TransportDuty[playerid] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't call for a taxi now!");
return 1;
}
new zone[MAX_ZONE_NAME];
new Float:x, Float:y, Float:z;
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "____________ TAXI DISPATCH PANEL _____________", PlayerInfo[playerid][pPnumber]);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "REQUESTING: {FFFFFF}Taxi Services");
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "DESTINATION: {FFFFFF}%s", zone);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "PHONE NUMBER: {FFFFFF}%i", PlayerInfo[playerid][pPnumber]);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "____________________________________________", PlayerInfo[playerid][pPnumber]);
SendJobMessage(17, COLOR_YELLOW, string);
format(string, sizeof(string), "To accept this service request; (type /ataxi %d)", playerid);
SendJobMessage(17, COLOR_WHITE, string);
/*format(string, sizeof(string), "** %s is in need of a taxi driver - click Accept to accept the call.", GetPlayerNameEx(playerid));
foreach(Player, i)
{
if(TransportDuty[i] > 0 && (PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17 || PlayerInfo[i][pTaxiLicense] == 1 ))
{
ShowPlayerDialog(i, DIALOG_ACCEPTDIALOG, DIALOG_STYLE_MSGBOX, "{FFFFFF}Taxi Call", string, "Accept", "Reject");
PlayerInfo[i][pAcceptID] =12;
}
}*/
SetPVarInt(playerid, "TaxiCaller", 1);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have called for a taxi driver, wait for a reply.");
TaxiCall = playerid;
PlayerInfo[playerid][pServiceTime] = 30;
return 1;
}
pawn Код:
CMD:ataxi(playerid, params[])
{
if(PlayerInfo[playerid][pJob] != 17 || PlayerInfo[playerid][pJob2] != 17) {
SendClientMessageEx(playerid, COLOR_GREY, " You are not a taxi driver!");
}
else {
new
szMessage[128],
iTarget;
if(sscanf(params, "i", iTarget)) {
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /ataxi [playerid]");
}
else if(!IsPlayerConnected(iTarget)) {
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
}
else if(iTarget == playerid) {
SendClientMessageEx(playerid, COLOR_GREY, "You can't accept your own service call.");
}
else if(!GetPVarType(iTarget, "TaxiCaller")) {
SendClientMessageEx(playerid, COLOR_GREY, "That person has not called for a service.");
}
else {
format(szMessage, sizeof(szMessage), "** Taxi Driver %s has accepted the service call from %s(%d)" , GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget), iTarget);
SendRadioMessage(10, COLOR_YELLOW, szMessage);
foreach(Player, i)
{
if(PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17)
{
SendClientMessageEx(i, COLOR_YELLOW, szMessage);
}
}
format(szMessage, sizeof(szMessage), "* Taxi driver %s has accepted your service call; please wait at your current position.",GetPlayerNameEx(playerid));
SendClientMessageEx(iTarget, COLOR_LIGHTBLUE, szMessage);
GameTextForPlayer(playerid, "~w~Taxi Caller~n~~r~Go to the red marker.", 5000, 1);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_RRCALL;
TaxiAccepted[playerid] = iTarget;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(iTarget, X, Y, Z);
SetPlayerCheckpoint(playerid, X, Y, Z, 5);
DeletePVar(iTarget, "TaxiCaller");
}
}
return 1;
}