OnplayerKey
#4

Quote:
Originally Posted by Jack-
View Post
How do I activate a command if the player is in range of point and pressed the right key?
im trying this

pawn Code:
if (newkeys == KEY_LOOK_BEHIND)
   {
        if IsPlayerInRangeOfPoint(playerid, 2030.6146,1896.3336,12.1973)
                {
        SendClientMessage(playerid, COLOR_BLUE, "TEST COMPLETE");
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED, "error");
        }
            return 1;
       }
idk what to do
For example you can fix your script. Like missing brackets after
PHP Code:
if 
?

Try this one:
PHP Code:
#include <a_samp>
#define COLOR_BLUE 0x00FF00FF
#define COLOR_RED 0xFF0000FF
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
newkeys == KEY_LOOK_BEHIND)
     {
          if(
IsPlayerInRangeOfPoint(playerid,5.02030.6146,1896.3336,12.1973))
        {
            
SendClientMessage(playeridCOLOR_BLUE"TEST COMPLETE");
            return 
1;
        }
        else
        {
            
SendClientMessage(playerid,COLOR_RED"error");
        }
        return 
1;
      }
    return 
1;

Reply


Messages In This Thread
OnplayerKey - by Jack- - 13.07.2011, 18:52
Re: OnplayerKey - by Famalamalam - 13.07.2011, 19:17
Re: OnplayerKey - by Jack- - 13.07.2011, 19:23
Re: OnplayerKey - by [MG]Dimi - 13.07.2011, 19:28

Forum Jump:


Users browsing this thread: 2 Guest(s)