My Taxi Job simple error -
Nuke547 - 19.02.2012
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:
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.");
}
}
}
Re: My Taxi Job simple error -
JhnzRep - 19.02.2012
pawn Код:
for (new i = 0; i != MAX_PLAYERS; ++i)
Try this.
Re: My Taxi Job simple error -
Nuke547 - 19.02.2012
Quote:
Originally Posted by JhnzRep
pawn Код:
for (new i = 0; i != MAX_PLAYERS; ++i)
Try this.
|
Nope, I just replaced it, but it still repeats it.
Re: My Taxi Job simple error -
JhnzRep - 19.02.2012
pawn Код:
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.");
}
}
return 1;
}
EDIT: Just went on Explict RP, and when I called a taxi, it only send the message once.
Re: My Taxi Job simple error -
Nuke547 - 19.02.2012
Didnt work
Re: My Taxi Job simple error -
JhnzRep - 19.02.2012
Your server doesn't spam it though o.O
Re: My Taxi Job simple error -
Nuke547 - 19.02.2012
Quote:
Originally Posted by JhnzRep
Your server doesn't spam it though o.O
|
It does for everybody else.