Vehicle Restriction - 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: Vehicle Restriction (
/showthread.php?tid=492428)
Vehicle Restriction -
DarkLored - 03.02.2014
So yesterday i asked about it and everything worked today i noticed with my friends that it removes me from all vehicles so i changed it to OnPlayerUpdate cause i saw some people using this method for rp servers and i tryed it to
but it dosent remove me from vehicle at all
pawn Код:
public OnPlayerUpdate(playerid)
{
new playerState = GetPlayerState(playerid);
if(IsPlayerInVehicle(playerid, 432) && playerState == PLAYER_STATE_DRIVER)
{
if(Engineer[playerid] != 1)
return RemovePlayerFromVehicle(playerid);
}
if(IsPlayerInVehicle(playerid, 520 || 425) && playerState == PLAYER_STATE_DRIVER)
{
if(Pilot[playerid] != 1)
return RemovePlayerFromVehicle(playerid);
}
return 1;
}
Re: Vehicle Restriction -
Vanter - 03.02.2014
so here's how I do it.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//Army Permissions
if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 425)
{
if(InAdminMode[playerid] == 0)
{
if(gTeam[playerid] != TEAM_ARMY)
{
SendClientMessage(playerid, COLOR_RED,"[ERROR] You must be an army officer in order to use this vehicle.");
ClearAnimations(playerid,1);
return 1;
}
}
}
return 1;
}
Re: Vehicle Restriction -
Beckett - 03.02.2014
You're aware that you're checking for a vehicle model not a vehicle ID, am I right?
Re: Vehicle Restriction -
DarkLored - 03.02.2014
Quote:
Originally Posted by DaniceMcHarley
You're aware that you're checking for a vehicle model not a vehicle ID, am I right?
|
Actually i am not cause i am new to scripting for vehicles never tried to change anything there
@Vanter thanks it helped you have been +REPED