Dectect player crouching bug? - 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: Dectect player crouching bug? (
/showthread.php?tid=370810)
Dectect player crouching bug? -
Kyra - 21.08.2012
Hello, i want detect if a player is crouching when pressed the touch "crouch" but doesn't work with
PHP код:
GetPlayerSpecialAction
and i don't want use
There is another possibility?
PHP код:
switch(GetPlayerWeapon(playerid))
{
case 23..25, 27, 29..34, 41:
{
if(GetPlayerSpecialAction(playerid) != 1)
{
if(PRESSED(KEY_CROUCH))
{
SendClientMessage(playerid,-1,"test");
}
}
}
}
Not Work with
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
when iam standing and i use touch "KEY_CROUCH)"
Re: Dectect player crouching bug? -
clarencecuzz - 21.08.2012
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CROUCH)
{
switch(GetPlayerWeapon(playerid))
{
case 23 .. 25, 27, 29 .. 34, 41:
{
if(GetPlayerSpecialAction(playerid) == 0)
{
SendClientMessage(playerid,-1,"test");
}
}
}
}
return 1;
}
Re : Dectect player crouching bug? -
Kyra - 21.08.2012
My problem its with this callback does not detect if the person dont moves so i used a timer for use in a variable with
PHP код:
(GetPlayerSpecialAction(playerid)
but i did not use a timer

but works ^^
Thx