SA-MP Forums Archive
[Pedido] DOF2 comandos - 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] DOF2 comandos (/showthread.php?tid=634863)



DOF2 comandos - zDark - 27.05.2017

Alguem pode me ajudar com o dof2, preciso do comando dof Ex: /Morrer "Sim" ou "Nгo" /Morrer sim - /Morrer nao
alguem pode me ajudar??


Re: DOF2 comandos - ViniBorn - 27.05.2017

Nгo seria dialog?

https://sampwiki.blast.hk/wiki/ShowPlayerDialog

PHP код:
//Topo
#define DIALOG_MORTE 123
// Comando /morrer
ShowPlayerDialog(playerid, DIALOG_MORTE, DIALOG_STYLE_MSGBOX, "Morte", "Deseja morrer?", "Sim", "Nгo");
//OnDialogResponse
if(dialogid == DIALOG_MORTE)
{
    if(
response) SetPlayerHealth(playerid, 0);
} 



Re: DOF2 comandos - zDark - 27.05.2017

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Nгo tipo esse comando mais em dof2:

PHP код:
    if(!strcmp(cmd, "/morrer", true))
    {
        if(!
strlen(tmp))
        {
              
SendClientMessage(playerid, COR_ERRO, "Uso vбlido: /Morrer [sim/nao]");
            return 
1;
        }
        else if(!
strcmp(tmp, "sim", true))
        {
        
//Funзгo
            
return 1;
        }
        else if(!
strcmp(tmp, "nao", true))
        {
        
//Funзгo
        
}
        return 
1;
    } 



Re: DOF2 comandos - ViniBorn - 27.05.2017

Fiz um exemplo ali em cima em dialog.

DOF2 tem a ver com arquivos.
Nгo seria zcmd/sscanf?


Re: DOF2 comandos - zDark - 27.05.2017

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Fiz um exemplo ali em cima em dialog.

DOF2 tem a ver com arquivos.
Nгo seria zcmd/sscanf?
Axo que sim nгo tem como montar uma base do codigo ?? /morrer sim ou nгo


Re: DOF2 comandos - ViniBorn - 27.05.2017

PHP код:
//ZCMD + SSCANF

CMD:morrer(playerid, params[])
{
    if(
isnull(params))
        return 
SendClientMessage(playerid, -1, "Digite sim ou nao.");

    if(!
strcmp(params,"sim"))
    {
        
SetPlayerHealth(playerid, 0);
        
SendClientMessage(playerid, -1, "Vocк escolheu morrer.");
    }
    else
        
SendClientMessage(playerid, -1, "Vocк escolheu nгo morrer.");        

    return 
true;
} 



Re: DOF2 comandos - zDark - 27.05.2017

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
PHP код:
//ZCMD + SSCANF
CMD:morrer(playerid, params[])
{
    if(
isnull(params))
        return 
SendClientMessage(playerid, -1, "Digite sim ou nao.");
    if(!
strcmp(params,"sim"))
    {
        
SetPlayerHealth(playerid, 0);
        
SendClientMessage(playerid, -1, "Vocк escolheu morrer.");
    }
    else
        
SendClientMessage(playerid, -1, "Vocк escolheu nгo morrer.");        
    return 
true;
} 
Viw ai pela ajuda +rep