Taxi Fare
#1

So when someone gets into taxi and taxi driver types /taxi start fare is going really fast, like in few seconds it's thousand

Code
PHP код:
stock ChargePerson(playerid)
{
    new 
string[128];
    if(
GetPlayerMoney(playerid) < TaxiMoney[playerid])
    {
    
format(string,sizeof(string),"%s doesn't have enough money to pay for the TAXI.",GetPlayerNameEx(playerid));
    
SendClientMessage(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITEstring);
        
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
        
TaxiMoney[playerid] = 0;
    }
    else
    {
        
format(stringsizeof(string), "[TAXI]: The final taxi fare has got to, $%d."TaxiMoney[playerid]);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
GivePlayerCash(playerid, -TaxiMoney[playerid]);
        
GivePlayerCash(GetVehicleDriver(OldVehicle[playerid]), TaxiMoney[playerid]);
        
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
        
TaxiMoney[playerid] = 0;
    }

PHP код:
    for(new 0MAX_VEHICLESi++)
    {
        if(
IsATaxi(i))
        {
            new 
driver GetVehicleDriver(i);
            if(
driver != INVALID_PLAYER_ID)
            {
                if(
TaxiDuty{driver} && TaxiStart{driver} && CountVehiclePlayers(i) > 0)
                {
                    new 
string[128];
                    
format(stringsizeof(string), "~y~TAXI FARE: $%d"TaxiMade[driver]);
                    
GameTextForPlayer(driverstring16);
                    for(new 
0MAX_PLAYERSp++)
                    {
                        if(
IsPlayerConnected(p) && PlayerInCar(p) && GetPlayerState(p) != PLAYER_STATE_DRIVER && GetPlayerVehicleID(p) == GetPlayerVehicleID(driver))
                        {
                            
format(stringsizeof(string), "~y~TAXI FARE: $%d"TaxiMoney[p]);
                            
GameTextForPlayer(pstring16);
                            
TaxiMoney[p] += TaxiFare{driver};
                            
TaxiMade[driver] += TaxiFare{driver};
                        }
                    }
                }
            }
        }
    } 
Reply


Messages In This Thread
Taxi Fare - by FaZeRs - 07.03.2014, 13:44
Re: Taxi Fare - by FaZeRs - 07.03.2014, 19:01
Re: Taxi Fare - by Anzipane - 07.03.2014, 20:27
Re: Taxi Fare - by FaZeRs - 07.03.2014, 20:45
Re: Taxi Fare - by FaZeRs - 08.03.2014, 20:58
Re: Taxi Fare - by FaZeRs - 09.03.2014, 15:00
Re: Taxi Fare - by Abagail - 09.03.2014, 15:06
Re: Taxi Fare - by FaZeRs - 09.03.2014, 15:12

Forum Jump:


Users browsing this thread: 1 Guest(s)