OnPlayerEnterVehicle problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerEnterVehicle problem (
/showthread.php?tid=565952)
FIXED -
Nabster - 02.03.2015
FIXED
Re: OnPlayerEnterVehicle problem -
ball - 02.03.2015
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(ispassenger)
{
if(!IsVehicleOccupied(vehicleid))
{
SendClientMessage(playerid, COLOR_RED, "Don't enter a vehicle without driver.");
return ClearAnimations(playerid);
}
}
return 1;
}
ClearAnimations is better solution, don't need to get/set player position.
Re: OnPlayerEnterVehicle problem -
CalvinC - 02.03.2015
What's your IsVehicleOccupied code?
Re: OnPlayerEnterVehicle problem -
Nabster - 02.03.2015
Код:
stock IsVehicleOccupied(vehicleid)
{
for(new i =0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i,vehicleid))
{
return 1;
}
}
return 0;
}
Re: OnPlayerEnterVehicle problem -
Nabster - 03.03.2015
bump
not working