Code stopping
#1

The code stops at GetPlayerWeapon, i did debug, thats how i figured out that.

pawn Код:
if( newkeys & KEY_FIRE )
    {
        print("1" );
        if( GetPlayerWeapon( playerid ) == 40 )
        {
         print("2" );
It never gets to 2.

EDIT:Nevermind, i figured out why, the weapon gets removed before this callback is called.
Reply
#2

So, bug fixed?
Reply
#3

No, i have another question, how to check when a player uses a weapon (FIRE) without using OnPlayerKeyStateChange?. Since when i press FIRE_KEY detonator is removed before OnPlayerKeyStateChange is called.
Reply
#4

Look GetPlayerKeys
Reply
#5

Guess it works only for updown rightleft?
Reply
#6

No. Example :

pawn Код:
public OnPlayerUpdate(playerid)
{
    new Keys,ud,lr;
    GetPlayerKeys(playerid,Keys,ud,lr);

    if(Keys == KEY_SPRINT)
        SendClientMessage(playerid, 0xFFFFFFFF, "KEY_SPRINT");
    else if(Keys == KEY_JUMP)
        SendClientMessage(playerid, 0xFFFFFFFF, "KEY_JUMP");

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)