OnPlayerShoot...
#1

Hi everyone i would like to make when a player tries to shoot deny it, so he wont shoot, any idea how i could make this work out? thanks.
Reply
#2

you want the players do not use guns?
Reply
#3

i want the player to have the gun but not to shoot, when he attempts to shoot cancel it.
Reply
#4

Ah sorry, i don't know what's this function.
Reply
#5

you can't, you can deny the damage they do by setting everyone to the same team and then processing the damage being dealt by every player using OnPlayerTakeDamage or OnPlayerGiveDamage
Reply
#6

you can try it in OnPlayerUpdate and key states which may be inaccurate but yes u can give a try like:
OnplayerUpdate -> GetKeys -> if key = aim & fire -> apply anim / slap him etc..
Reply
#7

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_FIRE)
    {
        if(GetPlayerWeapon(playerid) != 0)
        {
            SetPlayerArmedWeapon(playerid,0);
        }
    }
}
Not tested, but could work.
Reply
#8

if OnPlayerKeyStateChange is called then that means they've already pressed the keys
Reply
#9

Or maybe, Get the player's health,
When player is damaged by the other player, Set it back to current health.
Reply
#10

no, i need to cancel the shoot before he shoots i mean like when he's about to shoot cancel it, maybe an animation?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)