[Ajuda] OnPlayerKeyStateChange
#1

PHP код:
if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(
PlayerToPoint(1.0playerid397.6549,2462.5303,16.6809) || PlayerToPoint(1.0playerid5,17,10))
        {
            
ShowPlayerDialog(playeridDIALOG_ARMAZEMDIALOG_STYLE_LIST,"{B22222}»{FFFFFF} Armazйm da Favela","Equipar\n\nInformaзхes""Selecionar""Fechar");
        }
    } 
Bom se eu boto assim a DIALOG Abre em in-game agora se eu boto assim nгo abre nenhuma nem outra
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(
PlayerToPoint(1.0playerid395.7615,2462.4875,16.6809)/*BOCA DO PRZ*/ || PlayerToPoint(1.0playerid2889.5144,2804.2468,26.7554)/*BOCA ACR*/ || PlayerToPoint(1.0playerid, -227.7801,96.5845,2.0929)/*BOCA DA PL*/ || PlayerToPoint(1.0playerid5,17,10))
        {
            
ShowPlayerDialog(playeridDIALOG_ARMAZEMDIALOG_STYLE_LIST,"{B22222}»{FFFFFF} Armazйm da Favela","Equipar\n\nInformaзхes""Selecionar""Fechar");
        }
    } 
Alguem sabe me dizer pq
Reply
#2

Pq nгo й pra fazer isso! geniu!
coloca comentбrio em cima, ou do lado, mas nгo dentro do code! -'
boas praticas men!

PS: vocк esta usando errado "OnPlayerKeyStateChange" olhe na wiki : https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

PHP код:
if(PRESSED(KEY_SECONDARY_ATTACK)) 
Reply
#3

continua n abrindo
Reply
#4

alguem ajuda?
Reply
#5

Tenta Isso

Код:
#define PlayerTP1 PlayerToPoint(1.0, playerid, 395.7615,2462.4875,16.6809)/*BOCA DO PRZ*/
#define PlayerTP2 PlayerToPoint(1.0, playerid, 2889.5144,2804.2468,26.7554)/*BOCA ACR*/
#define PlayerTP3 PlayerToPoint(1.0, playerid, -227.7801,96.5845,2.0929)/*BOCA DA PL*/
#define PlayerTP4 PlayerToPoint(1.0, playerid, 5,17,10) /*BOCA DO KPTA*/

if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(PlayerTP1 || PlayerTP2 || PlayerTP3 || PlayerTP4)
        {
            ShowPlayerDialog(playerid, DIALOG_ARMAZEM, DIALOG_STYLE_LIST,"{B22222}»{FFFFFF} Armazйm da Favela","Equipar\n\nInformaзхes", "Selecionar", "Fechar");
        }
    }
Nгo tenho certeza se vai dar certo.
Reply
#6

Quote:

#define PlayerTP1 PlayerToPoint(1.0, playerid, 397.6549,2462.5303,16.6809)/*BOCA DO PRZ*/
#define PlayerTP2 PlayerToPoint(1.0, playerid, -2477.0764,2232.3950,4.8240)/*BOCA ACR*/
#define PlayerTP3 PlayerToPoint(1.0, playerid, -227.7801,96.5845,2.0929)/*BOCA DA PL*/
#define PlayerTP4 PlayerToPoint(1.0, playerid, 5,17,10) /*BOCA DO KPTA*/
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(PlayerTP1 || PlayerTP2 || PlayerTP3 || PlayerTP4)
{
ShowPlayerDialog(playerid, DIALOG_ARMAZEM, DIALOG_STYLE_LIST,"{B22222}»{FFFFFF} Armazйm da Favela","Equipar\n\nInformaзхes", "Selecionar", "Fechar");
}
}

coloquei assim fui em cima apertei F E N deu nd
Reply
#7

alguemmm?
Reply
#8

Usa o IsPlayerInRangeOfPoint
Reply
#9

Код:
#define     PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
	if( PRESSED( KEY_SECONDARY_ATTACK ))
	{
	    if( IsPlayerInRangeOfPoint( playerid, 3.0, 395.7615,2462.4875,16.6809 ) || // BOCA DO PRZ
	    IsPlayerInRangeOfPoint( playerid, 3.0, 2889.5144,2804.2468,26.7554 ) || // BOCA DO ACR
	    IsPlayerInRangeOfPoint( playerid, 3.0, -227.7801,96.5845,2.0929 )) // BOCA DA PL
	    {
	        ShowPlayerDialog( playerid, DIALOG_ARMAZEM, DIALOG_STYLE_LIST, "{B22222}»{FFFFFF} Armazйm da Favela", "Equipar\nInformaзхes", "Selecionar", "Fechar");
	    }
	}
}
Reply
#10

nem complia compilo mano crasho
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)