SA-MP Forums Archive
[[[Ajuda]]] Comandos por F - 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: [[[Ajuda]]] Comandos por F (/showthread.php?tid=280947)



[[[Ajuda]]] Comandos por F - Ichigo_Kurosaki - 03.09.2011

Olб caros amigos do Forum sa-mp, eu estou querendo transformar os comandos do meu GM todos para um simples aperto de F

O comando inicial seria esse:

pawn Код:
if(strcmp(cmd, "/autoescola", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(2.0, playerid, 1173.6765,1351.0183,10.9219))
            {
                new listitems[] = "1\tR$500   Motorista\n2\tR$3500 Aйrea\n3\tR$3000 Nбutica\n4\tR$400   Pesca\n5\tR$1200 Porte de Armas\n";
                ShowPlayerDialog(playerid,510,DIALOG_STYLE_LIST,"Lista de Testes:",listitems,"Confirmar","Sair");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  Vocк nгo estб na Auto Escola!");
            }
        }
        return 1;
    }
Como fasso, gostaria de aprender!!


Re: [[[Ajuda]]] Comandos por F - Bruno Pereira - 03.09.2011

PHP код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(
newkeys==KEY_SECONDARY_ATTACK)//-- LETRA "F"
    
{
        
OnPlayerCommandText(playerid,"/autoescola");
    }
    return 
true;
} 



Re: [[[Ajuda]]] Comandos por F - StrondA_ - 03.09.2011

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)//tecla
{
//adicione o CMD!
}
return true;
}
Quando ia postar nгo tinha nenhum poste '-'


Respuesta: [[[Ajuda]]] Comandos por F - Ichigo_Kurosaki - 03.09.2011

Sу adicionar no public isso?

pawn Код:
{
    if(newkeys==KEY_SECONDARY_ATTACK)//-- LETRA "F"
    {
        OnPlayerCommandText(playerid,"/autoescola");
    }
    return true;
}



Re: [[[Ajuda]]] Comandos por F - Bruno Pereira - 03.09.2011

Sim !


Re: [[[Ajuda]]] Comandos por F - StrondA_ - 03.09.2011

claro!


Re: [[[Ajuda]]] Comandos por F - WLSF - 03.09.2011

public OnPlayerKeyStateChange
(:


Re: [[[Ajuda]]] Comandos por F - Dolby - 03.09.2011

se voce quer dizer na public OnPlayerKeyStateChange sim,


Respuesta: [[[Ajuda]]] Comandos por F - Ichigo_Kurosaki - 03.09.2011

Mais tipo, eu posso deletar o comando

pawn Код:
if(strcmp(cmd, "/autoescola", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(2.0, playerid, 1173.6765,1351.0183,10.9219))
            {
                new listitems[] = "1\tR$500   Motorista\n2\tR$3500 Aйrea\n3\tR$3000 Nбutica\n4\tR$400   Pesca\n5\tR$1200 Porte de Armas\n";
                ShowPlayerDialog(playerid,510,DIALOG_STYLE_LIST,"Lista de Testes:",listitems,"Confirmar","Sair");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  Vocк nгo estб na Auto Escola!");
            }
        }
        return 1;
    }
e recriar assim:

pawn Код:
{
    if(newkeys==KEY_SECONDARY_ATTACK)//-- LETRA "F"
    {
if(strcmp(cmd, "/autoescola", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(2.0, playerid, 1173.6765,1351.0183,10.9219))
            {
                new listitems[] = "1\tR$500   Motorista\n2\tR$3500 Aйrea\n3\tR$3000 Nбutica\n4\tR$400   Pesca\n5\tR$1200 Porte de Armas\n";
                ShowPlayerDialog(playerid,510,DIALOG_STYLE_LIST,"Lista de Testes:",listitems,"Confirmar","Sair");
            }
            else
            {
    }
    return true;
}



Re: [[[Ajuda]]] Comandos por F - WLSF - 03.09.2011

nгo creio que funcione, deixe o comando do jeito que estб... e bote assim
pawn Код:
public OnPlayerKeyStateChange
{
if(IsPlayerConnected(playerid);
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
OnPlayerCommandText(playerid,"/autoescola");
return 1;
}
}
return 1;
}