19.02.2012, 23:06
Basically everything works, its just that when there are no taxi drivers are on duty, it gets raped and constantly sends that same message, "There are no taxi drivers on duty.".
Heres my code:
Heres my code:
PHP код:
command(service, playerid, params[])
{
new Usage[30], string[128];
if(sscanf(params, "z", Usage))
{
SendClientMessage(playerid, WHITE, "SYNTAX: /service [usage]");
SendClientMessage(playerid, WHITE, "Usage: taxi");
}
else
{
if(strcmp(Usage, "taxi", true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnectedEx(i) && (Player[i][Job] == 8 || Player[i][Job2] == 8) && OnTaxiDuty[i] == 1)
{
SendClientMessage(playerid, WHITE, "You have requested a taxi. Please be patient, and stay where you are.");
format(string, sizeof(string), "%s[ID:%d] has requested a taxi. To take his call, use /accepttaxi [playerid]", GetNameU(playerid), playerid);
SendClientMessage(i, WHITE, string);
PendingTaxiRequest[playerid] = 1;
}
else if(OnTaxiDuty[i] == 0)
{
SendClientMessage(playerid, WHITE, "There are no taxi drivers on duty.");
}
}
}
else
{
SendClientMessage(playerid, WHITE, "That is an invailid option.");
}
}
}