Posts: 18
Threads: 9
Joined: Oct 2008
Reputation:
0
I want to check.
If the player in the radious of the car (1.00000), you can lock/unlock the car.
How can I do that?
Posts: 18
Threads: 9
Joined: Oct 2008
Reputation:
0
if(!strcmp(cmd, "/lock", true))
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(vehicleid, vehx, vehy, vehz);
if(IsPlayerInRangeOfPoint(playerid,1.0,vehx,vehy,v ehz))
{
//CarsInfo[vehicleid][lock]=-1
if(CarsInfo[vehicleid][lock]==-1 || CarsInfo[vehicleid][lock]==0)
CarsInfo[vehicleid][lock]=1;
else
CarsInfo[vehicleid][lock]=0;
SetVehicleParamsForPlayer(vehicleid,playerid,0,Car sInfo[vehicleid][lock]);
}
return 1;
}
It doesn't working.
I mean, I can lock/unlock the car but only if I'm in the car.