just a question about keystatechange
#1

hey. i'm Going To Make If Someone Fires A Weapon In Public There Wanted Level Goes up. what should i be using.

should i use if holding key_fire || and if released? or if pressed and holding. im confused.
Reply
#2

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        if(GetPlayerWeapon(playerid) != 0) SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
    }
    return 1;
}
Reply
#3

getplayerweapon(playerid) != 0 detects if he fires a shot?
Reply
#4

Quote:
Originally Posted by Kar
Посмотреть сообщение
getplayerweapon(playerid) != 0 detects if he fires a shot?
No, it detects if the player has weapons or != 0
Reply
#5

thats the only way to do it?
Reply
#6

Quote:
Originally Posted by DJDhan
Посмотреть сообщение
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        if(GetPlayerWeapon(playerid) != 0) SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
    }
    return 1;
}
What if i try to parachute off of something ? What happends if im beating someone up with a parachute? What happens if i just simply hold down the fire button and spray everyone with bullets (would waste a whole clip, and only get 1 star lol) ?
Reply
#7

uh maybe try using GetPlayerWeapon(playerid) or something like that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)