SA-MP Forums Archive
KEY lol - 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)
+--- Thread: KEY lol (/showthread.php?tid=619753)



KEY lol - StR_MaRy - 21.10.2016

why on this server they have KEY_R ? i mean in keys wiki is not over there... how can i create it ?

proof: http://imgur.com/a/sIAbg


Re: KEY lol - ThatFag - 21.10.2016

i think they might be using this plugin which allows to find keyboard numbers as long as there is no "R" key at samp wikis.
https://sampforum.blast.hk/showthread.php?tid=268671


Re: KEY lol - Freaksken - 21.10.2016

Say player1 has bound KEY_FIRE to R (just an example, don't use KEY_FIRE btw):
Код:
new string[144 + 1]; //Adjust size to fit the string, without to much leftover size
if(!IsPlayerInAnyVehicle(playerid)) {
    format(string, sizeof(string), "..., press ~k~~PED_SPRINT~ to listen to music.");
} else {
    format(string, sizeof(string), "..., press ~k~~VEHICLE_ACCELERATE~ to listen to music.");    
}
SendClientMessage(playerid, -1, string);
The message will display to player1 as: ..., press R to listen to music.

Say player2 has KEY_FIRE as LeftMouseButton.
The message will display to player2 as: ..., press LMB to listen to music.


Re: KEY lol - Eoussama - 21.10.2016

Quote:
Originally Posted by Freaksken
Посмотреть сообщение
Say player1 has bound KEY_FIRE to R (just an example, don't use KEY_FIRE btw):
Код:
new string[144 + 1]; //Adjust size to fit the string, without to much leftover size
if(!IsPlayerInAnyVehicle(playerid)) {
    format(string, sizeof(string), "..., press ~k~~PED_SPRINT~ to listen to music.");
} else {
    format(string, sizeof(string), "..., press ~k~~VEHICLE_ACCELERATE~ to listen to music.");    
}
SendClientMessage(playerid, -1, string);
The message will display to player1 as: ..., press R to listen to music.

Say player2 has KEY_FIRE as LeftMouseButton.
The message will display to player2 as: ..., press LMB to listen to music.
would it be the same if I worked with the key Id"numeric" instead of "KEy_X" ?


Re: KEY lol - StR_MaRy - 21.10.2016

is not working in any way ... i want the key R

"ThatFag" that plugin is only for window server..


Re: KEY lol - Freaksken - 21.10.2016

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
would it be the same if I worked with the key Id"numeric" instead of "KEy_X" ?
If you mean that you want to use the function-value instead of the function-macro: yes of course you can, but why would you? Using the macro is so much easier to read.
If that is not what you meant, try to explain it a bit more.

Quote:
Originally Posted by StR_MaRy
Посмотреть сообщение
is not working in any way ... i want the key R
You can not check for keys on your keyboard. You can only check for the key-functions that are used in GTA SA.
If you have the "sprinting function" as the left-shift key, then you can make SA-MP check if the "sprinting function" was used. You can not make SA-MP check if the left-shift key was used.

Either that server just has bad code like this:
Код:
format(string, sizeof(string), "..., press R to listen to music.");
or you have the function they use bound to R.


Re: KEY lol - StR_MaRy - 21.10.2016

so how they did it ? explain pls ? someone i pressed R and it worked .. is not just a simple message


Re: KEY lol - Spmn - 21.10.2016

Quote:
Originally Posted by Freaksken
Посмотреть сообщение
Either that server just has bad code like this:
Код:
format(string, sizeof(string), "..., press R to listen to music.");
or you have the function they use bound to R.
Nah, R = radio key. OnPlayerKeyStateChange gets called when that key is presed, however I can't remember what bitmask is used, but you can easily find that by debugging OnPlayerKeyStateChange.


Re: KEY lol - Freaksken - 21.10.2016

Quote:
Originally Posted by Spmn
Посмотреть сообщение
Nah, R = radio key.
Really? Hmm never noticed.


Re: KEY lol - StR_MaRy - 21.10.2016

ok so no scripter from this site know how to solve this ... ohh