Duda[zcmd]
#1

Estoy usando zcmd & para ahorra lineas en mi pasado script use algo asн:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if ( dialogid == Dialogo )
   {
   if ( response )
   {
   switch ( listitem )
   {
   case 0: OnPlayerCommandText(playerid, "/command");
   case 1: OnPlayerCommandText(playerid, "/command");
   case 2: OnPlayerCommandText(playerid, "/command");
   }
   }
   return 1;
   }
   return 1;
}
La preguntas es .. ї Como puedo hacer esa funcion con zcmd ?.

La funciуn hace ejecutar un comando.
Reply
#2

Con ZCMD es muy simple.

Por ejemplo, si queremos llamar el comando "/hola" desde OnDialogResponse, hacemos:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if ( dialogid == Dialogo )
    {
        if ( response )
        {
            switch ( listitem )
            {
                case 0: cmd_hola(playerid);
            }
        }
        return 1;
    }
    return 1;
}
Y si nuestro comando tuviese parбmetros, los especificarнamos:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if ( dialogid == Dialogo )
    {
        if ( response )
        {
            switch ( listitem )
            {
                case 0: cmd_micomando(playerid, "misparбmetros");
            }
        }
        return 1;
    }
    return 1;
}
Espero que ayude y que sea lo que busques.
Reply
#3

O...

pawn Код:
CallLocalFunction("OnPlayerCommandText", "ds", playerid, "/micmd");
Reply
#4

Gracias seсoritas ..!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)