How To Make A Admin Vehicle Only! - 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 A Admin Vehicle Only! (
/showthread.php?tid=174419)
How To Make A Admin Vehicle Only! -
Moss - 05.09.2010
Please May I have A Example how to make a admin vehicle only!
Re: How To Make A Admin Vehicle Only! -
Burridge - 05.09.2010
pawn Код:
#include <a_samp>
new
AdminVehicle;
public OnFilterScriptInit()
{
AdminVehicle = AddStaticVehicle(541,711.4348,1948.3846,5.0976,179.8788, -1, -1); //Bullet
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(Vehicle == AdminVehicle && !IsPlayerAdmin(playerid))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0x33AA33AA, "I'm sorry, but this car has been reserved for Admins only!");
}
return 1;
}
Should work
(NOT TESTED). I also think there is a tutorial about somewhere. This also should've been posted in Scripting Discussion.
Re: How To Make A Admin Vehicle Only! -
willsuckformoney - 05.09.2010
Also wrong section. And that should work
Re: How To Make A Admin Vehicle Only! -
ipsBruno - 05.09.2010
@Burridge
Use
OnPlayerEnterVehicle
Good Code...
Re: How To Make A Admin Vehicle Only! -
Burridge - 05.09.2010
Quote:
Originally Posted by DraKiNs
@Burridge
Use OnPlayerEnterVehicle
Good Code...
|
Of-course! Silly me! Edited.
Re: How To Make A Admin Vehicle Only! -
Sergei - 05.09.2010
And use ClearAnimations, not RemovePlayerFromVehicle since player is entering vehicle and is not in vehicle.
Re: How To Make A Admin Vehicle Only! -
ipsBruno - 05.09.2010
Quote:
Originally Posted by Sergei
And use ClearAnimations, not RemovePlayerFromVehicle since player is entering vehicle and is not in vehicle.
|
pawn Код:
RemovePlayerFromVehicle(playerid);
new Float:x;Float:y;Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+1);
ClearAnimations(playerid);