Zeex / sampgdk

Write SA-MP gamemodes in C/C++
http://zeex.github.io/sampgdk
Apache License 2.0
156 stars 83 forks source link

Keys state #179

Closed buridan1999 closed 7 years ago

buridan1999 commented 7 years ago

I try to do some action when player holding key, and use information about how can I do it from this samp_wiki page -> http://wiki.sa-mp.com/wiki/OnPlayerKeyStateChange#Introduction

And when I paste this fragment of code: `// HOLDING(keys)

define HOLDING(%0) \

((newkeys & (%0)) == (%0))`

compiler said me, that it need identificator. Where is my mistake?

IstuntmanI commented 7 years ago

In C++ you can name your macro's parameters like how you want. They aren't using a percent sign.

#define HOLDING(keys) ((newkeys & (keys)) == (keys))

By the way, please don't post this kind of problems on GitHub issues. GitHub issues should be only for project's faults and eventually suggestions. For what you posted you have the forum or you can search on Google (stackoverflow wink wink).