SA-MP Forums Archive
How DO I Do this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How DO I Do this? (/showthread.php?tid=85628)



How DO I Do this? - BP13 - 08.07.2009

yes I already searched.


how do I make it so when some one enters a vehicle their car auto locks, and when the exit their car it auto unlocks.


Re: How DO I Do this? - kaisersouse - 08.07.2009

you did a REALLY shitty search then. This topic was discussed 3 days ago.


Re: How DO I Do this? - Danny_Costelo - 08.07.2009

OnPlayerStateChange && PLAYER_STATE_DRIVER = SetVehicleParamsForPlayer

OnPlayerExitVehicle call SetVehicleParamsForPlayer again.


Re: How DO I Do this? - -Sneaky- - 08.07.2009

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER)
  {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
      SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
    }
  }
  return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    SetVehicleParamsForPlayer(vehicleid,i,0,0);
  }
  return 1;
}
Try this



Re: How DO I Do this? - BP13 - 08.07.2009

Quote:
Originally Posted by kaisersouse
you did a REALLY shitty search then. This topic was discussed 3 days ago.
wow that was really mean and uncalled for.


Quote:
Originally Posted by Sneaky.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER)
  {
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
      SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
    }
  }
  return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    SetVehicleParamsForPlayer(vehicleid,i,0,0);
  }
  return 1;
}
Try this
It dident work