02.08.2014, 17:41
(
Last edited by ShinichiKudou; 02/08/2014 at 05:43 PM.
Reason: forgot to add the variable
)
@NGEN here is what you requested
And in his original script there is some bugs you need to press left alt then tab to unlock (will switch windows) because its inside the brackets of lALT ( i used notepad++ to check)
pawn Code:
#include <a_samp>
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new PlayerVehLocked[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_ACTION))//TAB KEY
{
if (IsPlayerInAnyVehicle(playerid))
{
if(PlayerVehLocked[playerid] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,false,false);
GameTextForPlayer(playerid, "Unlocked", 5000, 3);
}
else if(PlayerVehLocked[playerid] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,false,true);
GameTextForPlayer(playerid, "Locked", 5000, 3);
}
}
}
return 1;
}
//Press Tab to lock/unlock