Taxi Job bugged
#1

I make in my GM a taxi job but its bugged, the driver don't get money, the passenger don't give money, and the timer don't works. Gimme some ideas from what can be. When the passenger get in the taxi need to start count for the money at, but no count, no money gets, no money for the driver.
Reply
#2

How does the system work? we need more information if your not going to show us code.. when he types a command it brings up checkpoints? when he enters the checkpoint it pays him? it could be multiple things show us some code!
Reply
#3

This is where he need to pay.
Код:
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];
				}
Reply
#4

If someone call for taxi or hop in the cab, he need to drive to where the passenger wants, and when he left need to pick from passenger's money and give them to the taxi driver, but don't work.
Reply
#5

Someone help?
Reply
#6

Please help am gonna +rep this who help me
Reply
#7

Quote:
Originally Posted by toxicape
Посмотреть сообщение
Please help am gonna +rep this who help me
Simplify the system of issuing money and find an error.

You have a lot of extra variables.

Start simple: Go sit in the cab, checked his money > taxi driver gets money > etc
Reply
#8

Can't you fix this bug in the lines which i give? Because its a lot of work to put a new system on the GM.
Reply
#9

Quote:
Originally Posted by toxicape
Посмотреть сообщение
Can't you fix this bug in the lines which i give? Because its a lot of work to put a new system on the GM.
I can give you the code that is now written for you, analyzing it and add their own items

PHP код:
stock IsVehicleTaxi(vehicleid) {
    switch (
GetVehicleModel(vehicleid)) {
        case 
420,438 : return true;
    }
    return 
false;
}
forward OnPlayerEnteredTaxi(playeridvehicleid);
public 
OnPlayerEnteredTaxi(playeridvehicleid
{
    new 
        
msg[256],
        
name[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridnamesizeof(name));
    
format(msgsizeof(msg), "Taxi: %s(%d) entered in taxi %d"nameplayeridvehicleid);
    
SendClientMessageToAll(-1msg);
    return 
true;
}
forward OnPlayerExitedTaxi(playeridvehicleid);
public 
OnPlayerExitedTaxi(playeridvehicleid
{
    new 
        
msg[256],
        
name[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridnamesizeof(name));
    
format(msgsizeof(msg), "Taxi: %s(%d) exited in taxi %d"nameplayeridvehicleid);
    
SendClientMessageToAll(-1msg);    
    return 
true;
}
public 
OnPlayerUpdate(playerid)
{
    static
        
p_vehicleid[MAX_PLAYERS]
    ;
    new 
vehicleid GetPlayerVehicleID(playerid);
    if (
vehicleid && vehicleid != p_vehicleid[playerid]) {
        if (
IsVehicleTaxi(vehicleid)) {
            
OnPlayerEnteredTaxi(playeridvehicleid);
        }
        
p_vehicleid[playerid] = vehicleid;
    } else {
        if (
IsVehicleTaxi(p_vehicleid[playerid])) {
            
OnPlayerExitedTaxi(playeridp_vehicleid[playerid]);
        }
        
p_vehicleid[playerid] = vehicleid;
    }
    return 
1;

Reply
#10

Quote:
Originally Posted by toxicape
Посмотреть сообщение
TransportDriver[playerid] = i; // Error You are here
Why do you write in the player to be a taxi driver a passenger?

Or do you have in the variable i taxi driver?
The code is not fully represented.

PS: Poor you do not want to disassemble my example, it clearly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)