OnPlayerKeyStateChange.
#1

Hi all.Now i need some help with keys here:

Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if (newkeys & KEY_CROUCH)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 10.0, X, Y, Z))
{
GameTextForPlayer(i,"~b~Please stop",3000,5);
}
}
}
How you see,i want to do when player press KEY_CROUCH then nearest players gets gametext i have to that,but how to do that who pressed key not get this game text
Reply
#2

Start learning here:
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

No loop is nessecary to check if or when a player presses a key...
Reply
#3

pawn Код:
if(IsPlayerConnected(i) && i != playerid && IsPlayerInRangeOfPoint(i, 10.0, X, Y, Z))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)