what function should i use? -
xXitsgodzillaXx - 25.04.2012
i was curious cause im working on a VIP system right? and DMing isnt allowed on my server and i want to make VIP only vehicles. and i want to make it so if a player tried to get in that specific vehicle it will remove them from it, soo i was just wondering what function i should use to make the vehicle of course im going to use "GetPlayerVehicleID" but the paramaters dont have any thing about the veh ID. help plox?
Re: what function should i use? -
ReneG - 25.04.2012
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
Re: what function should i use? -
xXitsgodzillaXx - 25.04.2012
Quote:
Originally Posted by VincentDunn
|
giving links dont really help and im not that illiterate with this language and plus im already using that one lol
, i want to remove the players from specific vehicles. how would i do that?
like for instance im trying this ATM
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerVipType(playerid, 0))
if(GetPlayerVehicleID(playerid) == 1)
if(vehid > 520)
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
return 1;
}
but its not removing the player from the vehicle.
Re: what function should i use? -
Azazelo - 25.04.2012
Use timer for 4sec in on player enter vehicle.
Re: what function should i use? -
SuperViper - 25.04.2012
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerVipType(playerid, 0) && GetVehicleModel(vehicleid) > 520)
{
ClearAnimations(playerid);
SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
}
return 1;
}
Re: what function should i use? -
Ballu Miaa - 25.04.2012
You can do it like this for restricting a single car on the whole server.
pawn Код:
new VIPCar1 = CreateVehicle Code over here;//Add this under OnGameModeInIt
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerVipType(playerid, 0))
{
if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not.
{
SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Re: what function should i use? -
MP2 - 25.04.2012
OnPlayerEnterVehicle is called when a player
STARTS to enter a vehicle. You should use OnPlayerStateChange, which will pass 'newstate' as 2 if they enter a vehicle as a driver, and if you use GetPlayerVehicleID you can check if it is a VIP vehicle or not, if so use RemovePlayerFromVehicle.
Re: what function should i use? -
xXitsgodzillaXx - 25.04.2012
Quote:
Originally Posted by Ballu Miaa
You can do it like this for restricting a single car on the whole server.
pawn Код:
new VIPCar1 = CreateVehicle Code over here;//Add this under OnGameModeInIt
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsPlayerVipType(playerid, 0)) { if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not. { SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!"); RemovePlayerFromVehicle(playerid); } } return 1; }
|
should it be like this?
pawn Код:
new VIPCar1 = 520;
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerVipType(playerid, 0))
{
if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not.
{
SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Re: what function should i use? -
Ballu Miaa - 25.04.2012
Quote:
Originally Posted by xXitsgodzillaXx
should it be like this?
pawn Код:
new VIPCar1 = 520;
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsPlayerVipType(playerid, 0)) { if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not. { SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!"); RemovePlayerFromVehicle(playerid); } } return 1; }
|
Like this:
pawn Код:
new VIPCar1 = CreateVehicle(490,2578.1166,-2431.7924,13.6278,314.8088,0,0,5 * 60 * 1000);
// Add the above line under OnGameModeInIt Callback.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerVipType(playerid, 0))
{
if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not.
{
SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
EDIT:
But you should keep this in mind too.
Quote:
Originally Posted by MP2
OnPlayerEnterVehicle is called when a player STARTS to enter a vehicle. You should use OnPlayerStateChange, which will pass 'newstate' as 2 if they enter a vehicle as a driver, and if you use GetPlayerVehicleID you can check if it is a VIP vehicle or not, if so use RemovePlayerFromVehicle.
|
Re: what function should i use? -
xXitsgodzillaXx - 25.04.2012
Quote:
Originally Posted by Ballu Miaa
Like this:
pawn Код:
new VIPCar1 = CreateVehicle(490,2578.1166,-2431.7924,13.6278,314.8088,0,0,5 * 60 * 1000); // Add the above line under OnGameModeInIt Callback.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(IsPlayerVipType(playerid, 0)) { if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not. { SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!"); RemovePlayerFromVehicle(playerid); } } return 1; }
EDIT:
But you should keep this in mind too.
|
this is close to what i want. uh i want it to be it so that if they spawn one or if the find one they wont be able to get in, or get removed.