SA-MP Forums Archive
How to make auto eject - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make auto eject (/showthread.php?tid=189298)



How to make auto eject - PilotXtreme - 11.11.2010

I want to make a vehicle non enterable unless you are an admin.

I have a vague idea of what it might look like but i don't know where to put the code.
I'd also like someone to tell me what the code would be.


Re: How to make auto eject - (SF)Noobanatior - 11.11.2010

ban a model
pawn Код:
onplayerstatechange
new model;
model = GetVehicleModel(GetPlayerVehicleID(playerid));
if(model == Bannedmodel && !IsPlayerAdmin(playerid))RemovePlayerFromVehicle(playerid);
there ya go have a play with that change bannedmodel to the admin car
or ban a single car
pawn Код:
onplayerstatechange
new vid;
vid = GetPlayerVehicleID(playerid);
if(vid == Bannedvehicleid && !IsPlayerAdmin(playerid))RemovePlayerFromVehicle(playerid);



Re: How to make auto eject - PilotXtreme - 11.11.2010

Where exactly would i put the vehicle id in the single vehicle removal?


Re: How to make auto eject - (SF)Noobanatior - 11.11.2010

where it says "bannedvehicleid"

This forum requires that you wait 120 seconds between posts. Please try again in 55 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 46 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 39 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 24 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 18 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 6 seconds.


Re: How to make auto eject - PilotXtreme - 11.11.2010

e.g Maverick would be

Код:
new vid;vid = GetPlayerVehicleID(playerid);if(vid == Bannedvehicleid == 487) && !IsPlayerAdmin(playerid))RemovePlayerFromVehicle(playerid);
?


Re: How to make auto eject - (SF)Noobanatior - 11.11.2010

like
pawn Код:
new vid;
vid = GetPlayerVehicleID(playerid);
if(vid == 487) && !IsPlayerAdmin(playerid))RemovePlayerFromVehicle(playerid);
but i know the 487 is the modelid of a maverick not a vehicle id so unless there in the 487 vehicle you loaded this wont work
so do you want to ban people from all mavericks or just that one?


Re: How to make auto eject - PilotXtreme - 11.11.2010

From just one maverick

AddStaticVehicle(487,-221.8909,2658.0103,62.7782,181.4946,46,46);


Re: How to make auto eject - (SF)Noobanatior - 11.11.2010

at the topof your script go
pawn Код:
new adminveh;
then change that line to
pawn Код:
adminveh = AddStaticVehicle(487,-221.8909,2658.0103,62.7782,181.4946,46,46);
then use
pawn Код:
new vid;
vid = GetPlayerVehicleID(playerid);
if(vid == adminveh && !IsPlayerAdmin(playerid))RemovePlayerFromVehicle(playerid);



Re: How to make auto eject - PilotXtreme - 11.11.2010

OK Got it working now, thanks!


Re: How to make auto eject - Rafa - 11.11.2010

hmm what is that vid :/