How to lock a car for EVERYONE...?
#1

hey. How do I lock a car for every player on the server? I've tried many things with VehicleStream in and Paramsforplayer but I can't get it to work.

Thanks.
Reply
#2

lock the vehicle in onplayerstreamin ,
lock.. vehicleid , forplayerid params: 0,1
Reply
#3

Код:
for(new a=0; a < MAX_PLAYERS; a++)
	{
	SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),a,0,1);
	}
Reply
#4

Quote:
Originally Posted by CJ101
Код:
for(new a=0; a < MAX_PLAYERS; a++)
	{
	SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),a,0,1);
	}
Didn't work. But if you type

SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),playerid,0,1);

doesn't that mean that it locks the car for everyone except Playerid??

Then if you make MAX_PLAYERS it would make the car open for all players? =/
Reply
#5

Use OnVehicleStreamIn...

Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
	SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	return 1;
}
Reply
#6

Quote:
Originally Posted by BlackFoX_UD_
Use OnVehicleStreamIn...

Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
	SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
	return 1;
}
Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
	SetVehicleParamsForPlayer(Rentcar,forplayerid,0,1);
	return 1;
}
It doesn't lock the rentcars at all...
Reply
#7

BUMP... Need help ;O
Reply
#8

Once again. BUMP...

Does anyone know why it doesn't work? =/
Reply
#9

pawn Код:
new IsVehicleLocked[MAX_VEHICLES][2]; // 0 is if it is locked or not and 1 the one which the car is not locked for
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
  if(IsVehicleLocked[vehicleid][0] == 1)
  {
    if(IsVehicleLocked[vehicleid][1] != forplayerid) SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
  }
  return 1;
}
Just remember to use that variable to lock it and set a invalid player ID if no one is gonna use it.
Reply
#10

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


Forum Jump:


Users browsing this thread: 4 Guest(s)