04.06.2009, 21:02
How do I make it so a player has to be in a certain vehicle for a command to work? Please HELP
if(IsPlayerInVehicle(playerid,/*Here you put the vehicle ID*/))return SendClientMessage(playerid,RED,"You Need to be in a certain vehicle for this to work!");
Originally Posted by -The_Badger-
pawn Код:
|
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Float:X,Float:Y, Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if(IsPlayerInVehicle(playerid,/*the vehicle*/)){
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid, 0, 1);
SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}