07.03.2014, 13:44
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
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_WHITE, string);
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
else
{
format(string, sizeof(string), "[TAXI]: The final taxi fare has got to, $%d.", TaxiMoney[playerid]);
SendClientMessage(playerid, COLOR_YELLOW, string);
GivePlayerCash(playerid, -TaxiMoney[playerid]);
GivePlayerCash(GetVehicleDriver(OldVehicle[playerid]), TaxiMoney[playerid]);
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
}
PHP код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(IsATaxi(i))
{
new driver = GetVehicleDriver(i);
if(driver != INVALID_PLAYER_ID)
{
if(TaxiDuty{driver} && TaxiStart{driver} && CountVehiclePlayers(i) > 0)
{
new string[128];
format(string, sizeof(string), "~y~TAXI FARE: $%d", TaxiMade[driver]);
GameTextForPlayer(driver, string, 1, 6);
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(IsPlayerConnected(p) && PlayerInCar(p) && GetPlayerState(p) != PLAYER_STATE_DRIVER && GetPlayerVehicleID(p) == GetPlayerVehicleID(driver))
{
format(string, sizeof(string), "~y~TAXI FARE: $%d", TaxiMoney[p]);
GameTextForPlayer(p, string, 1, 6);
TaxiMoney[p] += TaxiFare{driver};
TaxiMade[driver] += TaxiFare{driver};
}
}
}
}
}
}