14.08.2012, 12:04
Quote:
I still do recommend using OnPlayerStateChange, because a player can still abort the entering even after OnPlayerEnterVehicle is called. If this happens, you will end up with a bugged system.
|
edit: so I commented out everything except that function so I can test it and changed "== 0" to "== 1" so it should sendclientmessage 0 when I CAN enter vehicle
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger == 0)
{
if(CanEnterVehicle(playerid, vehicleid) == 1)
{
SendClientMessage(playerid, -1, "0");
//return 1;
}
else
SendClientMessage(playerid, -1, "1");
//pDriver[playerid] = 1;
}
/*FuelTimer[playerid] = SetTimerEx("VehicleFuelUpdate", 15000, 1, "ii", playerid, vehicleid);
TextDrawSetOutline(tSpeed[playerid], 1);
TextDrawShowForPlayer(playerid, tSpeed[playerid]);
new str[32];
format(str, sizeof(str), "%d l", Fuel[vehicleid]);
TextDrawSetString(tFuel[playerid], str);
TextDrawSetOutline(tFuel[playerid], 1);
TextDrawShowForPlayer(playerid, tFuel[playerid]);
SpeedTimer[playerid] = SetTimerEx("VehicleUpdate", 400, 1, "ii", playerid, vehicleid);*/
return 1;
}