Vip Vehicles
#1

I want to prevent default player to enter in vehicle like hydra, hunter , tank etc
can anyone teach how can I do this
Reply
#2

What do you use to check weather they are a "default" user or not? Just the fact that they are logged in as RCON? Or do you have somethine more like pInfo[playerid][Admin]?

If you are just using RCON, then you can do this..

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!IsPlayerAdmin(playerid){
        if(!ispassenger){
            new vmodel;
            vmodel = GetVehicleModel(vehicleid);
            if(vmodel == 520 || vmodel == 432 || vmodel == 425){ //if the vehicle is a hydra, rhino, or hunter
                return 0;
                SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to use this vehicle");
            }
        }
    }
    return 1;
}
Haven't tested it, should work though. It should only let "regular" (non rconed users) to get into the passenger seat of any of the vehicles you add into this code. None of the current ones have passenger seats though. If they try to enter the driver seat, they are sent a message.
Reply
#3

You can create a checking inside the public OnPlayerEnterVehicle, or otherwise OnPlayerStateChange.
Example:
pawn Код:
if(GetVehicleModel(vehicleid) == SomeID)
{
new Float:x,Float:y,Float:z;
SetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid,-1,"You cannot enter this vehicle!");
return 1;
}
That's for OnPlayerEnterVehicle, and you have to add you own checking for if the player is a regular player or not.
Reply
#4

Thanks
Reply
#5

but i ment like only vip users can use this vehicle ... im building a vip system to my server , and i want to make hunter , hydra and a tank for vips
Reply
#6

Just replace the
pawn Код:
if(!IsPlayerAdmin(playerid){
with whatever you use to detect if they are "VIP"
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)