15.03.2011, 14:55
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.
{
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.