SA-MP Forums Archive
Se puede hacer esto?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Se puede hacer esto?? (/showthread.php?tid=393766)



Se puede hacer esto?? - GokuJahaziel - 19.11.2012

Pues mi idea es que si se puede lograr esto:

Que al presionar cierta tecla (o combinacion de teclas) se haga determinada funcion. por ejemplo. Presiono la tecla Alt, dentro de un auto... y este sale volando, flota o no se, lo que se les ocurra...

Esa es mi idea, me gustaria saber si se puede hacer porque tengo una idea genia para mi server.

Espero que me puedan ayudar...


Respuesta: Se puede hacer esto?? - Parka - 19.11.2012

PHP код:
#include a_samp

#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))


public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_FIRE))
    {
         
SetPlayerHealthplayerid 100 );
    }
    return 
1;




Respuesta: Se puede hacer esto?? - GokuJahaziel - 19.11.2012

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
PHP код:
#include a_samp
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_FIRE))
    {
         
SetPlayerHealthplayerid 100 );
    }
    return 
1;

Vere si me funciona, si funciona te aviso...


Respuesta: Se puede hacer esto?? - xSDx - 19.11.2012

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
PHP код:
#include a_samp
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_FIRE))
    {
         
SetPlayerHealthplayerid 100 );
    }
    return 
1;

no veo la necesidad de usar [php.] [/php.] pudiendo usar [pawn.] [/pawn.]


Respuesta: Se puede hacer esto?? - EduGTA - 19.11.2012

їOnPlayerKeyStateChange?


Respuesta: Se puede hacer esto?? - GokuJahaziel - 19.11.2012

Quote:
Originally Posted by Edugta.
Посмотреть сообщение
Me quedare con esta info... Gracias Edugta.
Si necesito mas ayuda aqui les aviso jeje.


Respuesta: Se puede hacer esto?? - CaptainMactavish - 20.11.2012

No se puede detectar teclas que no estan "bindeadas" o ligadas a una funciуn del GTA.