SA-MP Forums Archive
/lock script passengers allowed - 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)
+--- Thread: /lock script passengers allowed (/showthread.php?tid=360432)



/lock script passengers allowed - kbalor - 17.07.2012

Well I have here a /lock script, But when I do use /lock. It locks everything passenger and back seats.
And i only want to lock the driver's seat. How?

Код:
CMD:lock(playerid, params[])
{
	new Float:X, Float:Y, Float:Z;
	new vehicleid = GetPlayerVehicleID(playerid);
	GetVehiclePos(vehicleid, X, Y, Z);
	if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You must be in a vehicle to use this command!");
	{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	SetVehicleParamsForPlayer(vehicleid,i,0,1);
	GameTextForPlayer(playerid, "~y~Vehicle ~r~Locked", 2000, 3);
	}
	}
	return 1;
}



Re: /lock script passengers allowed - Steven82 - 17.07.2012

You can't just lock only one door. It'll lock all of them.


Re: /lock script passengers allowed - kbalor - 17.07.2012

Quote:
Originally Posted by Steven82
Посмотреть сообщение
You can't just lock only one door. It'll lock all of them.
So can you make script have unlock command? When player do /lock it also unlock the vehicle (Only Driver can use /lock) and a GameTextForPlayer appear "Vehicle Unlock"


Re: /lock script passengers allowed - [KHK]Khalid - 17.07.2012

https://sampforum.blast.hk/showthread.php?tid=246878
https://sampforum.blast.hk/showthread.php?tid=9584