How To Make A Admin Vehicle Only!
#1

Please May I have A Example how to make a admin vehicle only!
Reply
#2

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.
Reply
#3

Also wrong section. And that should work
Reply
#4

@Burridge

Use OnPlayerEnterVehicle

Good Code...
Reply
#5

Quote:
Originally Posted by DraKiNs
Посмотреть сообщение
@Burridge

Use OnPlayerEnterVehicle

Good Code...
Of-course! Silly me! Edited.
Reply
#6

And use ClearAnimations, not RemovePlayerFromVehicle since player is entering vehicle and is not in vehicle.
Reply
#7

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);
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)