Help pls
#1

Ay, i wanted to do a script that hides your radar blip if you're crouching and shows it again if you're standing.
There's a function for this, luckily, called GetPlayerSpecialAction, and one of those special actions is crouching.

So i did my code like this:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(PRESSED(KEY_CROUCH))
	{
		if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
		{
	     	SendClientMessage(playerid, 0x00FF00FF, "stealtherino");
 			for(new i = GetPlayerPoolSize(); i != -1; --i)
		 	{
		  		SetPlayerColor( playerid, ( GetPlayerColor(playerid) & 0xFFFFFF00 ) );
		 	}
		}
		
		else if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
		{
		 	SendClientMessage(playerid, 0x00FF00FF, "unstealtherino");
 			for(new i = GetPlayerPoolSize(); i != -1; --i)
		 	{
	 		SetPlayerColor( playerid, ( GetPlayerColor(playerid) | 0x000000FF ) );
	 		}
		}
	}
 return 1;
}
But, for some reason, whenever i stand up from crouching and i stand still, it still detects me as if i'm crouching, typing out "stealtherino" instead of "unstealtherino".
But, whenever i move and press C, it types out "unstealtherino".
This makes me think the player's special action state is still crouching when they stand still after they stood up from crouching and only changes when they move or aim.

It isn't that big of a deal, but is there any way around this?
Please, i'd love some help, thanks.
Reply
#2

bump?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)