Quote:
Originally Posted by PotH3Ad
Try this:
pawn Код:
new LockWep[MAX_PLAYERS]; new LockOn[MAX_PLAYERS];
public OnPlayerConnect(playerid) { LockOn[playerid] = 0; return 1; }
public OnPlayerUpdate(playerid) { if(LockOn[playerid] == 1) { if(GetPlayerWeapon(playerid) != LockWep[playerid]) SetPlayerArmedWeapon(playerid, LockWep[playerid]); } return 1; }
//Use "LockPlayerWeapon(playerid, weaponid)" to set the player's locked weapon. //Use "UnlockPlayerWeapon(playerid)" to disable the weapon lock
stock LockPlayerWeapon(playerid, weaponid) { LockOn[playerid] = 1; LockWep[playerid] = weaponid; return 1; }
stock UnlockPlayerWeapon(playerid) { LockOn[playerid] = 0; LockWep[playerid] = -1; }
|
Thanks, I'll try it out. Will post back if it works.
EDIT: It works, thanks