SA-MP Forums Archive
[Pedido] Render com a tecla Y - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Render com a tecla Y (/showthread.php?tid=574632)



Render com a tecla Y - SukMathcuck - 19.05.2015

Estou a procura de um codigo, o codigo й, a pessoa pressiona a tecla Y e ela levanta os braзos com uma animaзгo, tentei fazer e nгo consgui, alguem sabe?


Re: Render com a tecla Y - VinnyScript - 19.05.2015

Funcao OnPlayerKeyStateChange Boa sorte


Re: Render com a tecla Y - viniciuship - 19.05.2015

Simples:
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_YES))
    {
        
SetPlayerSpecialAction(playerid10);
    }
    return 
1;

Se por acaso queira fazer com outra funзгo veja:
https://sampwiki.blast.hk/wiki/Keys


Re: Render com a tecla Y - n0minal - 19.05.2015

Quote:
Originally Posted by viniciuship
Посмотреть сообщение
Simples:
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_YES))
    {
        
SetPlayerSpecialAction(playerid10);
    }
    return 
1;

Se por acaso queira fazer com outra funзгo veja:
https://sampwiki.blast.hk/wiki/Keys
Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



Re: Render com a tecla Y - SukMathcuck - 19.05.2015

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Obrigado leo, com sua ajuda de um define eu tive a soluзгo, tipo, agora eu queria saber como colocar, tipo, a pessoa sу pode render pelo Y caso esteja fora de um veiculo, como faзo isso?

meu codigo:
PHP код:
    if (PRESSED(KEY_YES)) //Handsup Y
    

        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_HANDSUP); 
    } 



Re: Render com a tecla Y - Mark009 - 19.05.2015

Quote:
Originally Posted by SukMathcuck
Посмотреть сообщение
Obrigado leo, com sua ajuda de um define eu tive a soluзгo, tipo, agora eu queria saber como colocar, tipo, a pessoa sу pode render pelo Y caso esteja fora de um veiculo, como faзo isso?

meu codigo:
PHP код:
    if (PRESSED(KEY_YES)) //Handsup Y
    

        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_HANDSUP); 
    } 
PHP код:
    if(!IsPlayerInAnyVehicle(playerid)) // Se o jogador nгo estiver em um veнculo, o cуdigo posterior serб executado.
    
{
        if (
PRESSED(KEY_YES)) //Handsup Y
        

            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_HANDSUP); 
        }
    }