SA-MP Forums Archive
Define KEY_AIM! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Define KEY_AIM! (/showthread.php?tid=189181)



Define KEY_AIM! - ColdXX - 10.11.2010

Can someone tell me how to define KEY_AIM?
I have it like this

pawn Код:
#define KEY_AIM (128) found somewhere!
If someone can help please also explain whats to be explained!

Thanks.


Re: Define KEY_AIM! - rs.pect - 10.11.2010

I don't understand your post, but to define this, you simply need to add:
pawn Код:
#define KEY_AIM (128)
to your gamemode / filterscript.

After defining it, you can use it simply in OnPlayerKeyStateChange, just as default defined keys. Example:
pawn Код:
if(newkeys & KEY_AIM && !IsPlayerInAnyVehicle(playerid))



Re: Define KEY_AIM! - ColdXX - 10.11.2010

i have tried that but it wont work
when i press the key nothing happens
i made the system,should stop the vehicle,
ive setted vehicle velocity to 0
x,y,z=0 so it should work i guess!


Re: Define KEY_AIM! - rs.pect - 10.11.2010

You can't do this. You can only use these keys that do something in game. For example, if you set in your client key configuration, space to shot, then KEY_FIRE is called with space.


Re: Define KEY_AIM! - ColdXX - 10.11.2010

So there is no way to use that key to stop the vehicle?


Re: Define KEY_AIM! - rs.pect - 10.11.2010

Currently, can't. But it's possible to bypass this - writing a plugin which would get every key pressed by player, but it would need a client application, like it's in Audio Plugin.


Re: Define KEY_AIM! - ColdXX - 10.11.2010

ah i see alright thanks for the infos!


Re: Define KEY_AIM! - dark_clown - 10.11.2010

didnt get your point?


Re: Define KEY_AIM! - ColdXX - 10.11.2010

Well Here It's saying that KEY_AIM must be defined,i was asking how to define it lol!


Re: Define KEY_AIM! - The_Moddler - 10.11.2010

pawn Код:
#define KEY_AIM 132

if(newkeys == KEY_AIM && !IsPlayerInAnyVehicle(playerid))
That will work.