My Taxi Job simple error
#1

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(serviceplayeridparams[])
{
    new 
Usage[30], string[128];
    if(
sscanf(params"z"Usage))
    {
        
SendClientMessage(playeridWHITE"SYNTAX: /service [usage]");
        
SendClientMessage(playeridWHITE"Usage: taxi");
    }
    else
    {
        if(
strcmp(Usage"taxi"true) == 0)
        {
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnectedEx(i) && (Player[i][Job] == || Player[i][Job2] == 8) && OnTaxiDuty[i] == 1)
                {
                    
SendClientMessage(playeridWHITE"You have requested a taxi. Please be patient, and stay where you are.");
                    
format(stringsizeof(string), "%s[ID:%d] has requested a taxi. To take his call, use /accepttaxi [playerid]"GetNameU(playerid), playerid);
                    
SendClientMessage(iWHITEstring);
                    
PendingTaxiRequest[playerid] = 1;
                }
                else if(
OnTaxiDuty[i] == 0)
                {
                    
SendClientMessage(playeridWHITE"There are no taxi drivers on duty.");
                }
            }
        }
        else
        {
            
SendClientMessage(playeridWHITE"That is an invailid option.");
        }
    }

Reply
#2

pawn Код:
for (new i = 0; i != MAX_PLAYERS; ++i)
Try this.
Reply
#3

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.
Reply
#4

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.
Reply
#5

Didnt work
Reply
#6

Your server doesn't spam it though o.O
Reply
#7

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Your server doesn't spam it though o.O
It does for everybody else.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)