remove player from vehicle
#1

i am using a vip system and want a vehicle to be only use dby vips how to do this ? the vehicles are on the server already i have the id i need i just dont no what to do with it
Reply
#2

OnPlayerEnterVehicle callback check if vips < 1 and
pawn Код:
RemovePlayerFromVehicle(playerid);
. This is for entering a vehicle. If you are using vehicle spawner on your code check again if it's less than 1 level and remove player.
Reply
#3

right i get that bit but what i dont get is how to make the vehiclemodel id say 435 for roadtrains only vips can use
Reply
#4

Quote:
Originally Posted by [LHT]Bally
Посмотреть сообщение
right i get that bit but what i dont get is how to make the vehiclemodel id say 435 for roadtrains only vips can use
Explain, sir?
Reply
#5

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
Explain, sir?
so say if 20 roadtrains are parked up an your a player who is not a vip , when you enter the vehicle it removes you and says you are not vip so cant use this vehicle
Reply
#6

Can you tell us the variable for your VIP? Or more simply how do you check if a player is VIP in your script?
Reply
#7

pawn Код:
if ( P_DATA[ playerid ][ Vip ] >= 1 )
Reply
#8

hmm something like that
if you are using 3 vip levels

pawn Код:
under OnPlayerEnterVehicle callback
new vehid;
vehid == GetPlayerVehicleID(playerid);
if(vehid == 435 && ( P_DATA[ playerid ][ Vip ] <= 1)) return SendClientMessage(playerid,-1,"ERROR:only vip level 1 can enter this vehicle");
RemovePlayerFromVehicle(playerid);
else
{
//.....
}
Reply
#9

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new vehicle;
    vehicle = GetPlayerVehicleID(playerid);
    if(vehicle == 435) {
        if(P_DATA[playerid][Vip] <1) return RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
Quote:
Originally Posted by vassilis
Посмотреть сообщение
hmm something like that
if you are using 3 vip levels

pawn Код:
under OnPlayerEnterVehicle callback
new vehid;
vehid == GetPlayerVehicleID(playerid);
if(vehid == roadtrainid && ( P_DATA[ playerid ][ Vip ] >= 1) ) return SendClientMessage(playerid,-1,"ERROR:only vip level 1 can enter this vehicle");
RemovePlayerFromVehicle(playerid);
else
{
//.....
}
So, VIPs 1 + level will be removed. Change it to "<1"
Reply
#10

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(vid ==VIP_CAR_ID/*Change this*/)
        {
            if ( P_DATA[ playerid ][ Vip ] >= 1 ) return 1;
            else if(! P_DATA[ playerid ][ Vip ] >= 1 )
            {
                SendClientMessage(playerid, -1, "This is a VIP vehicle, SIR.");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
Please change the VIP_CAR_ID to the car you want the player to be removed from. This is an untested code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)