05.09.2010, 17:37
Please May I have A Example how to make a admin vehicle only!
#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;
}
And use ClearAnimations, not RemovePlayerFromVehicle since player is entering vehicle and is not in vehicle.
|
RemovePlayerFromVehicle(playerid);
new Float:x;Float:y;Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+1);
ClearAnimations(playerid);