I need help
#1

I want to do something in "OnPlayerKeyStateChange"
But i want a key like this..
pawn Код:
if(newkeys & KEY_HORN)
but it says
pawn Код:
C:\Documents and Settings\Ironboy\Desktop\Windows server\gamemodes\Paradise_City.pwn(2203) : error 017: undefined symbol "KEY_HORN"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
how to fix it? plz help me
Reply
#2

Put this under INC's
pawn Код:
#define KEY_HORN 2
Reply
#3

what is INC? you mean Includes?
Reply
#4

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
what is INC? you mean Includes?
Yes.
Reply
#5

Why not then just:
pawn Код:
if(newkeys && 2)
?
Also, you had to put the & twice (&&).
Reply
#6

Quote:
Originally Posted by Mean
Посмотреть сообщение
Also, you had to put the & twice (&&).
Mean, you're wrong once again. You really need to stop posting and gain understanding of how SA-MP works before you continue to make yourself look even more stupid.

The single '&' sign is required for the operation for bit masking, the single sign indicates that the operation in use is a bitwise AND sign and not a logical AND operator.

Add the code:
pawn Код:
#define KEY_HORN 2
Or (doing it properly, providing 2 is the correct code for it) - there's no need for the useless macro
pawn Код:
if(newkeys & 2)
Reply
#7

ok ty very much
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)