SA-MP Forums Archive
[FilterScript] Very simple Lock Unlock system - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Very simple Lock Unlock system (/showthread.php?tid=264466)



Very simple Lock Unlock system - [BP]Tony - 26.06.2011

Hey all
I dont know what title to get on

Okay that simple Lock Unlock system

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp(cmdtext, "/lock", true)==0)
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
				new State=GetPlayerState(playerid);
				if(State!=PLAYER_STATE_DRIVER)
				{
					SendClientMessage(playerid,0xFFFF00AA,"You can only lock the doors as the driver.");
					return 1;
				}
				new i;
				for(i=0;i<MAX_PLAYERS;i++)
				{
					if(i != playerid)
					{
						SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
					}
				}
				SendClientMessage(playerid, 0xFFFF00AA, "Vehicle locked!");
		    	new Float:pX, Float:pY, Float:pZ;
				GetPlayerPos(playerid,pX,pY,pZ);
				PlayerPlaySound(playerid,1056,pX,pY,pZ);
				locked[playerid][GetPlayerVehicleID(playerid)] = 1;
			}
Like that
And unlock
Код:
if (strcmp(cmdtext, "/unlock", true)==0)
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
				new State=GetPlayerState(playerid);
				if(State!=PLAYER_STATE_DRIVER)
				{
					SendClientMessage(playerid,0xFFFF00AA,"You can only lock the doors as the driver.");
					return 1;
				}
				new i;
				for(i=0;i<MAX_PLAYERS;i++)
				{
					SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
				}
				SendClientMessage(playerid, 0xFFFF00AA, "Vehicle unlocked!");
				new Float:pX, Float:pY, Float:pZ;
				GetPlayerPos(playerid,pX,pY,pZ);
				PlayerPlaySound(playerid,1057,pX,pY,pZ);
				locked[playerid][GetPlayerVehicleID(playerid)] = 0;
			}
yeah...
Okay
You need click here To download it


Re: Very simple Lock Unlock system - Skaizo - 26.06.2011

your upload is bad
source and fixed: http://pastebin.com/0jCPx1rc
I fixed becouse get eror:
Код:
C:\Documents and Settings\Sandu\Desktop\Untitled.pwn(1) : error 010: invalid function or declaration
C:\Documents and Settings\Sandu\Desktop\Untitled.pwn(3) : error 013: Unknown Directive



Re: Very simple Lock Unlock system - Loading... - 26.06.2011

thanks


Re: Very simple Lock Unlock system - tvl1996 - 26.06.2011

what are the keys to lock/unlock? or do you must type: /lock and /unlock?


Re: Very simple Lock Unlock system - Laronic - 26.06.2011

Quote:
Originally Posted by tvl1996
Посмотреть сообщение
what are the keys to lock/unlock? or do you must type: /lock and /unlock?
You must type it


Re: Very simple Lock Unlock system - Loading... - 26.06.2011

you must type /lock and /unlock no special key


Re: Very simple Lock Unlock system - tvl1996 - 26.06.2011

I am in the car and locked him, i can get out of the car. He isnt locked.....
And if im out of the car, i can get in the car.


Re: Very simple Lock Unlock system - [BP]Tony - 26.06.2011

When you get in car you need to type /lock and no one will get it
When you want exit type /unlock and get out
If you get out without unlock the car will still locked...


AW: Very simple Lock Unlock system - Forbidden - 26.06.2011

XD nice job


Re: Very simple Lock Unlock system - [BP]Tony - 26.06.2011

Tnx dude