SA-MP Forums Archive
/lock command - 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: /lock command (/showthread.php?tid=129039)



/lock command - Headshot1108 - 20.02.2010

now in the 0.3 version, how its work?
i know with OnVehicleStreamIn, but it does not work.

my command:

pawn Код:
if (strcmp(cmdtext, "/lock", true) == 0)
  {
  if(IsPlayerInAnyVehicle(playerid))
  {
  new State=GetPlayerState(playerid);
  if(State!=PLAYER_STATE_DRIVER)
  {
  SendClientMessage(playerid,gelb,"You can look the doors only you are the driver.");
  return 1;
  }
  new i;
  for(i=0;i<MAX_PLAYERS;i++)
  {
  if(i != playerid)
  {
  SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
  }
  }
  SendClientMessage(playerid, gelb, "Vehicle look");
  new Float:pX, Float:pY, Float:pZ;
  GetPlayerPos(playerid,pX,pY,pZ);
  PlayerPlaySound(playerid,1056,pX,pY,pZ);
  locked[playerid][GetPlayerVehicleID(playerid)] = 1;
  }
  else
  {
  SendClientMessage(playerid, rot, "You don't are in a Vehicle!");
  }
  return 1;
  }
callback:

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
  vehid[forplayerid] = vehicleid;
  return 1;
}



Re: /lock command - VonLeeuwen - 20.02.2010

https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer


Re: /lock command - Headshot1108 - 20.02.2010

yes, but lol must I set every car a variable??


Re: /lock command - Headshot1108 - 20.02.2010

anyone?


Re: /lock command - smeti - 21.02.2010

I recommend this script:
http://forum.sa-mp.com/index.php?topic=137706.0


Re: /lock command - Headshot1108 - 21.02.2010

thanks


Re: /lock command - MadeMan - 21.02.2010

Top of script

pawn Код:
new VehicleLock[MAX_VEHICLES];
In your /lock command

pawn Код:
VehicleLock[GetPlayerVehicleID(playerid)] = 1;
and the callback

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
  if(VehicleLock[vehicleid] == 1)
  {
    SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
  }
  return 1;
}



Re: /lock command - Headshot1108 - 21.02.2010

dont work