SA-MP Forums Archive
RemovePlayerFromVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: RemovePlayerFromVehicle (/showthread.php?tid=552559)



RemovePlayerFromVehicle - PowerF - 25.12.2014

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 ]


Re: RemovePlayerFromVehicle - Shinta307 - 25.12.2014

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;




Re: RemovePlayerFromVehicle - Ryz - 25.12.2014

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 ;/


Re: RemovePlayerFromVehicle - PowerF - 25.12.2014

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.


Re: RemovePlayerFromVehicle - PowerF - 25.12.2014

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


Re: RemovePlayerFromVehicle - Ryz - 25.12.2014

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



Re: RemovePlayerFromVehicle - PowerF - 25.12.2014

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?


Re: RemovePlayerFromVehicle - PowerF - 25.12.2014

bump


Re: RemovePlayerFromVehicle - Ryz - 25.12.2014

Any problem with pasting error codes?


Re: RemovePlayerFromVehicle - PowerF - 25.12.2014

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