30.10.2014, 22:22
You need to finish your command with returning 1 if I'm right.
EDIT:
Also, function GetPlayerVehicleID only work if player is in any vehicle. That's why your command is working only when the player is in the car. You need to create a vehicle when the player joins the server and then save vehicleid to your variable. For example:
Код:
return doors -> return 1;
Also, function GetPlayerVehicleID only work if player is in any vehicle. That's why your command is working only when the player is in the car. You need to create a vehicle when the player joins the server and then save vehicleid to your variable. For example:
pawn Код:
enum pInfo
{
pVehModel,
pVehicle
};
new PlayerData[MAX_PLAYERS][pInfo];
// under on player connect
if(PlayerData[playerid][pVehModel])
pVehicle = CreateVehicle(...);
// and in your command
GetVehiclePos(PlayeData[playerid][pVeh], x, y, z);
If(IsPlayerInRangeOfPoint(playerid, 4, x, y, z))
...