24.08.2015, 23:56
Need help for this, when passenger get in he don't pay, and the driver don't get money. There is a bug here somewhere.
Код:
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0) { if(GetPlayerCash(playerid) < TransportValue[i]) { new string[28]; format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); //RemovePlayerFromVehicle(playerid); new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); SetPlayerPos(playerid, X, Y, Z+2); TogglePlayerControllable(playerid, 1); } else { new string[64]; if(TransportDuty[i] == 1) { format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Passenger %s has entered your Taxi.", GetPlayerNameEx(playerid)); SendClientMessageEx(i, COLOR_LIGHTBLUE, string); TransportTime[i] = 1; TransportTime[playerid] = 1; TransportCost[playerid] = TransportValue[i]; TransportCost[i] = TransportValue[i]; TransportDriver[playerid] = i; } else if(TransportDuty[i] == 2) { format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Passenger %s has entered your Taxi.", GetPlayerNameEx(playerid)); SendClientMessageEx(i, COLOR_LIGHTBLUE, string); } GivePlayerCash(playerid, -TransportValue[i]); TransportMoney[i] += TransportValue[i]; }