[FilterScript] Very simple Lock Unlock system
#1

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
Reply


Messages In This Thread
Very simple Lock Unlock system - by [BP]Tony - 26.06.2011, 11:50
Re: Very simple Lock Unlock system - by Skaizo - 26.06.2011, 11:59
Re: Very simple Lock Unlock system - by Loading... - 26.06.2011, 15:27
Re: Very simple Lock Unlock system - by tvl1996 - 26.06.2011, 15:32
Re: Very simple Lock Unlock system - by Laronic - 26.06.2011, 15:35
Re: Very simple Lock Unlock system - by Loading... - 26.06.2011, 15:39
Re: Very simple Lock Unlock system - by tvl1996 - 26.06.2011, 15:55
Re: Very simple Lock Unlock system - by [BP]Tony - 26.06.2011, 18:36
AW: Very simple Lock Unlock system - by Forbidden - 26.06.2011, 18:38
Re: Very simple Lock Unlock system - by [BP]Tony - 26.06.2011, 18:39

Forum Jump:


Users browsing this thread: 1 Guest(s)