player will be jump after alt+tab / set player - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: player will be jump after alt+tab / set player (
/showthread.php?tid=628440)
[NOT FIXED] player will be jump after alt+tab / set player -
kloning1 - 10.02.2017
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(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_WALK))
{
if(pendingjump[playerid] > 0) return SCM(playerid, -1,"you must wait 20 second");
if(icanjump[playerid] == true)
{
new Float:vx, Float:vy, Float:vz, str[254];
GetPlayerVelocity(playerid,vx,vy,vz);
SetPlayerVelocity(playerid,vx,vy*1.0,vz+0.8* 1.2);
SCM(playerid, -1, "ALT Press! you get a jump");
pendingjump[playerid] = 20;
}
}
return 1;
}
Re: player will be jump after alt+tab / set player -
X337 - 10.02.2017
Because when you do ALT + Tab, you pressed ALT.
Re: player will be jump after alt+tab / set player -
kloning1 - 10.02.2017
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
Re: player will be jump after alt+tab / set player -
Macronix - 10.02.2017
Show us your command code then
Re: player will be jump after alt+tab / set player -
kloning1 - 10.02.2017
Quote:
Originally Posted by Macronix
Show us your command code then
|
comand to set player jump?
here
PHP код:
CMD:setjump(playerid, params[])
{
if(pInfo[playerid][pAdmin] > 0 )
{
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;
}