How can I do this?
#4

You could give a try to this:

PHP Code:
new LockWeapon[MAX_PLAYERS];
new 
LockOn[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
LockOn[playerid] = 0;
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    if(
LockOn[playerid] == 1)
    {
        if(
GetPlayerWeapon(playerid) != LockWeapon[playerid]) SetPlayerArmedWeapon(playeridLockWeapon[playerid]);
    }
    return 
1;
}
stock LockPlayerWeapon(playeridweaponid)
{
    
LockOn[playerid] = 1;
    
LockWeapon[playerid] = weaponid;
    return 
1;
}
stock UnlockPlayerWeapon(playerid)
{
    
LockOn[playerid] = 0;
    
LockWeapon[playerid] = -1;

Use LockPlayerWeapon(playerid, weaponid) to lock the weapon.
Use UnlockPlayerWeapon(playerid) unlock the weapon.
Reply


Messages In This Thread
How can I do this? - by Yerro - 10.08.2015, 16:04
Re: How can I do this? - by Tamy - 10.08.2015, 16:11
Re: How can I do this? - by SoFahim - 10.08.2015, 16:15
Re: How can I do this? - by Michael B - 10.08.2015, 16:17
Re: How can I do this? - by SickAttack - 10.08.2015, 16:23
Respuesta: How can I do this? - by Yerro - 10.08.2015, 16:32

Forum Jump:


Users browsing this thread: 2 Guest(s)