problem with car lock script
#3

pawn Код:
CMD:vlock(playerid, params[])
{
 new oldcar = LastCar[playerid];
 new Float:cX, Float:cY, Float:cZ;
 GetVehiclePos(oldcar, cX, cY, cZ);
 new string[128];
 new engine,lights,alarm,doors,bonnet,boot,objective;
 GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
 if(!IsPlayerInRangeOfPoint(playerid, 4, cX, cY, cZ))
 {
  SendClientMessage(playerid,red,"You're not in range/in the Vehicle you last drove!");
  return 1;
 }
 else if(IsPlayerInRangeOfPoint(playerid, 4, cX, cY, cZ))
 {
    if(doors != 1)
    {
     doors = 1;
     SetVehicleParamsEx(oldcar,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
      SendClientMessage(playerid, 0xFFFFFFAA, " You've locked the vehicle!");
      return 1;
    }
    else
    {
     doors = 0;
     SetVehicleParamsEx(oldcar,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
     SendClientMessage(playerid, 0xFFFFFFAA, " You've unlocked the vehicle!");
     return 1;
    }
 }
 return doors;
}
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
    LastCar[playerid] = vehicleid;
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    LastCar[playerid] = vehicleid;
    return 1;
}
Reply


Messages In This Thread
problem with car lock script - by fireboy - 30.09.2012, 16:44
Re : problem with car lock script - by Amine_Mejrhirrou - 30.09.2012, 17:05
Re: problem with car lock script - by trapstar2020 - 30.09.2012, 17:39
Re: Re : problem with car lock script - by fireboy - 30.09.2012, 18:50
Re: problem with car lock script - by HyDrAtIc - 30.09.2012, 18:53
Re: problem with car lock script - by fireboy - 30.09.2012, 19:03

Forum Jump:


Users browsing this thread: 1 Guest(s)