player will be jump after alt+tab / set player
#1

hi, I'm just learning and enters KEY STATE

that I wanted to ask, why every player alt + tab / when I change it into a jump, he will jump, though not in the press KEY

PHP код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_WALK))
    {
        if(
pendingjump[playerid] > 0) return SCM(playerid, -1,"you must wait 20 second");
        if(
icanjump[playerid] == true)
        {
            new 
Float:vxFloat:vyFloat:vzstr[254];
            
GetPlayerVelocity(playerid,vx,vy,vz);
            
SetPlayerVelocity(playerid,vx,vy*1.0,vz+0.81.2);
            
SCM(playerid, -1"ALT Press! you get a jump");
            
pendingjump[playerid] = 20;
        }
    }
    return 
1;

Reply
#2

Because when you do ALT + Tab, you pressed ALT.
Reply
#3

Quote:
Originally Posted by X337
Посмотреть сообщение
Because when you do ALT + Tab, you pressed ALT.
um, okey reasonable
but when I set he could jump
he instantly jump, though not pressing KEY
Reply
#4

Show us your command code then
Reply
#5

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Show us your command code then
comand to set player jump?
here
PHP код:
CMD:setjump(playeridparams[])
{
    if(
pInfo[playerid][pAdmin] > )
    {
        new 
id;
        if(
sscanf(params"d"id))
        {
            
SCM(playerid, -1"Usage: /setjump [id]");
        }
        else
        {
            if(
icanjump[id] == false)
            {
                
icanjump[id] == true;
                
SCM(playerid, -1,"You have set id: ... can be more jump");
            }
            else if(
icanjump[id] == true)
            {
                
icanjump[id] == false;
                
SCM(playerid, -1,"You have set id: ... can not be more jump");
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)