RemovePlayerFromVehicle
#1

how do i set vehicle just for VIPs?
so if regular player enter the vehicle
regular player will not be entered the vehicle

my code
if ( P_DATA[ playerid ][ P_Vip ]
Reply
#2

Maybe

on top your script
PHP код:
new VEHICLENAMED[2]; //you can change it :) 
create vehicles
PHP код:
VEHICLENAMED[1] = CreateVehicle(4802396.6541, -1655.328113.1088, -101.0000, -1, -1100);
VEHICLENAMED[2] = CreateVehicle(4792397.0120, -1665.830813.0888, -55.0000, -1, -1100); 
stock
PHP код:
VEHICLENAME(carid//you can change it :)
{
    for(new 
0sizeof(VEHICLENAMED); v++)
    {
        if(
carid == VEHICLENAMED[v])
        {
        }
        return 
1;
    }
    return 
0;

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
        if(
VEHICLENAME(vehicleid)) //change vehicle name
        
{
            if ( 
P_DATAplayerid ][ P_Vip ]
            {
            }
            else
            {
                    
RemovePlayerFromVehicle(playerid);
                       new 
Float:slxFloat:slyFloat:slz;
                    
GetPlayerPos(playeridslxslyslz);
                    
SetPlayerPos(playeridslxslyslz);
                    
SendClientMessage(playeridCOLOR_GREY"You are not VIP!");
            }
        }
    return 
1;

Reply
#3

easy way

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
    new Float:PosX,Float:PosY,Float:PosZ,model = GetVehicleModel(vehicleid);

    if(model == blabla) // vip car model
    {
        if ( !P_DATA[ playerid ][ P_Vip ] ) or if ( P_DATA[ playerid ][ P_Vip ] < 0)
        {
            GetPlayerPos(playerid,PosX,PosY,PosZ);
            SetPlayerPos(playerid,PosX,PosY,PosZ);
            SendClientMessage(playerid, -1, "buy vip first man");
        }
    }
    return 1;
}

edit:OOPS LATE ;/
Reply
#4

Quote:
Originally Posted by Ryz
Посмотреть сообщение
easy way

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
    new Float:PosX,Float:PosY,Float:PosZ,model = GetVehicleModel(vehicleid);

    if(model == blabla) // vip car model
    {
        if ( !P_DATA[ playerid ][ P_Vip ] ) or if ( P_DATA[ playerid ][ P_Vip ] < 0)
        {
            GetPlayerPos(playerid,PosX,PosY,PosZ);
            SetPlayerPos(playerid,PosX,PosY,PosZ);
            SendClientMessage(playerid, -1, "buy vip first man");
        }
    }
    return 1;
}

edit:OOPS LATE ;/
this is what i thought.
gonne test it.
Reply
#5

Quote:
Originally Posted by PowerF
Посмотреть сообщение
this is what i thought.
gonne test it.
error.
Reply
#6

see
pawn Код:
if ( !P_DATA[ playerid ][ P_Vip ] ) or if ( P_DATA[ playerid ][ P_Vip ] < 0)
Use any 1 only

like if u have vip lvl system than use
pawn Код:
if ( P_DATA[ playerid ][ P_Vip ] < 0)
and if no

than use
pawn Код:
if ( !P_DATA[ playerid ][ P_Vip ] )
And here add your vip car model

pawn Код:
if(model == blabla) // change blabla to yours
Reply
#7

Quote:
Originally Posted by Ryz
Посмотреть сообщение
see
pawn Код:
if ( !P_DATA[ playerid ][ P_Vip ] ) or if ( P_DATA[ playerid ][ P_Vip ] < 0)
Use any 1 only

like if u have vip lvl system than use
pawn Код:
if ( P_DATA[ playerid ][ P_Vip ] < 0)
and if no

than use
pawn Код:
if ( !P_DATA[ playerid ][ P_Vip ] )
And here add your vip car model

pawn Код:
if(model == blabla) // change blabla to yours
same.
can someone do it?
Reply
#8

bump
Reply
#9

Any problem with pasting error codes?
Reply
#10

Quote:
Originally Posted by Ryz
Посмотреть сообщение
Any problem with pasting error codes?
blank when Recompile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)