Cannot enter a vehicle need level... -
Gamer007 - 28.05.2009
How can i do if a player isn't level 2 he couldn't enter car id 451 A.k.a turismo?
Re: Cannot enter a vehicle need level... -
Hot - 28.05.2009
Did you have a variable for level?
Re: Cannot enter a vehicle need level... -
Gamer007 - 28.05.2009
what do you mean?
i got em defined like this:
Код:
enum Level
{
Lygis // this is level
Patirtis... and so on
}
and then i got
Код:
new pLevel[MAX_PLAYERS][Level];
i tryed to do this car thingy but i made it somehow for every car
Re: Cannot enter a vehicle need level... -
OmeRinG - 28.05.2009
in the public OnPlayerEnterVehicle:
pawn Код:
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid,px,py,pz);
if(TheWayYouGetThePlayerLevelGoesHere < 2) return SetPlayerPos(playerid,px,py,pz);
return 1;
replace TheWayYouGetThePlayerLevelGoesHere in the way you get the player's level.
Re: Cannot enter a vehicle need level... -
Weirdosport - 28.05.2009
pawn Код:
//OnPlayerEnterVehicle
if(GetVehicleModel(vehicleid) == 451)
{
if(pLevel[playerid][Level] < 2) RemovePlayerFromVehicle(playerid)
}
Re: Cannot enter a vehicle need level... -
Gamer007 - 28.05.2009
Код:
pLevel[playerid][Level] < 2)
lolz now thats wrong
it should be
pLevel[playerid][Lygis]
kk..
is it possible to lock a car for him instead of setting his pos?
btw i think ur code weirdo won't work i tryed it few mins ago. i enterd a car it displayed me a msg, but i still entered it lol.
Re: Cannot enter a vehicle need level... -
OmeRinG - 28.05.2009
setting his pos will get him out of the car.
but if you want locking you can do AddVehicleParametersForPlayer one of the ID's is locked...
https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
to lock:
SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),playerid,0,1);
Re: Cannot enter a vehicle need level... -
Gamer007 - 28.05.2009
setting his pos only deletes the key enter when you pressed so it's like i press enter he runs for the car and then stops, p.s u didn't define the vehicles id :P
Re: Cannot enter a vehicle need level... -
Hot - 28.05.2009
public OnPlayerEnterVehicle:
Код:
if(GetPlayerVehicleID(playerid) == 451)
{
if(pLevel[playerid] == 2)
{
return 1;
}
else
SendClientMessage(playerid, COLOR_WHITE, "You have been removed from the vehicle, you need to be level 2." RemovePlayerFromVehicle(playerid);
}
OBS: Created from my head.
Re: Cannot enter a vehicle need level... -
Djiango - 28.05.2009
I would like to say this one more time.
RemovePlayerFromVehicle, doesn't work in the "OnPlayerEnterVehicle" callback.
Because his not in the vehicle.
You would have to delay the "RemovePlayerFromVehicle(playerid);" with a timer.
Or use another callback.
*Hint: OnPlayerStateChange