01.05.2011, 22:09
I have a problem with the OnPlayerStateChange function. Nothing is working while I get into a car.
Here is the full public code:
http://pastebin.com/bKU97sLv
I'll show you a few examples where the problem is:
So, when I go IG and I try to enter a bus or a rental vehicle for exmaple, it will let me drive it without saying that I don't have the keys, or I don't have the job.
Here is the full public code:
http://pastebin.com/bKU97sLv
I'll show you a few examples where the problem is:
pawn Код:
else if(newcar >= 112 && newcar <= 130)
{
if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "Vehicle Rental:Rent a vehicle for $%d /rentcar",SBizzInfo[1][sbEntranceCost]);
SendClientMessage(playerid,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_GREEN,"Rent a vehicle,and you will be able to /rlock your car");
TogglePlayerControllable(playerid, 0);
VehAsk[playerid] = 1;
}
}
pawn Код:
if(IsABus(newcar))
{
if(PlayerInfo[playerid][pJob] != 14)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys to this bus.");
TogglePlayerControllable(playerid,true);
VehAsk[playerid] = 0;
}
else
{
if(JobDelay[playerid] > 0)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid,true);
VehAsk[playerid] = 0;
SendClientMessage(playerid, COLOR_GREY," You need to wait for Your last route time to reduce !");
}
else if(BusRoute[playerid] == 0)
{
ShowMenuForPlayer(BusRoutesM, playerid);
BusRoute[playerid] = 1;
gPlayerCheckpointStatus[playerid] = CHECKPOINT_BUSROUTE;
BusRouteS[playerid] = 0;
}
}
}
pawn Код:
else if(IsATowcar(newcar))
{
if(PlayerInfo[playerid][pJob] != 7)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");
TogglePlayerControllable(playerid,true);
VehAsk[playerid] = 0;
}
}
So, when I go IG and I try to enter a bus or a rental vehicle for exmaple, it will let me drive it without saying that I don't have the keys, or I don't have the job.