SA-MP Forums Archive
їCуmo creo varios 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: їCуmo creo varios comandos? (/showthread.php?tid=547439)



їCуmo creo varios comandos? - DarNeell - 22.11.2014

Miren.

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/deagle", cmdtext, true, 10) == 0)
GivePlayerWeapon(playerid, 24, 999);
SendClientMessage(playerid, 0x00E40000, "Escogiste una degale");
return 1;
}

public OnPlayerCommand(playerid,cmdtext [])
{
if (strcmp("/combate", cmdtext, true, 10) == 0)
GivePlayerWeapon(playerid, 27, 999);
SendClientMessage(playerid, 0x00E40000, "Escogiste una escopeta de combate");
return 1;
}

Y me da tres warnings y en el sv no funciona..

Quote:

C:\Users\Jose\Documents\NuevoServidorIker\gamemode s\Untitled.pwn(9 : warning 217: loose indentation
C:\Users\Jose\Documents\NuevoServidorIker\gamemode s\Untitled.pwn(102) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommand")
C:\Users\Jose\Documents\NuevoServidorIker\gamemode s\Untitled.pwn(106) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.




Respuesta: їCуmo creo varios comandos? - aoEXE - 22.11.2014

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/comando", cmdtext, true, 8) == 0)
    {
        //funciones
        return 1;
    }
    if (strcmp("/comando2", cmdtext, true, 9) == 0)
    {
        //funciones
        return 1;
    }
    if (strcmp("/comando3", cmdtext, true, 9) == 0)
    {
        //funciones
        return 1;
    }
    //...
    return 0;
}
Tutoriales, FAQ y mas


Respuesta: їCуmo creo varios comandos? - fabianlamas33 - 22.11.2014

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/deagle", cmdtext, true, 8) == 0)
    {
      GivePlayerWeapon(playerid, 24, 999);
      SendClientMessage(playerid, 0x00E40000, "Escogiste una degale");
        return 1;
    }
    if (strcmp("/combate", cmdtext, true, 9) == 0)
    {
       GivePlayerWeapon(playerid, 27, 999);
       SendClientMessage(playerid, 0x00E40000, "Escogiste una escopeta de combate");
        return 1;
    }
    return 0;
}



Re: їCуmo creo varios comandos? - DarNeell - 22.11.2014

Gracias me sirvieron їOtra cosa? Es mejor ZCMD o STRCMD?
Me refiero a : Mбs fбcil


Respuesta: їCуmo creo varios comandos? - hotspicytaco - 22.11.2014

STRCMP*

ZCMD es mбs fбcil de usar.


Respuesta: їCуmo creo varios comandos? - fabianlamas33 - 23.11.2014

A mi me gusta mas usar zcmd, es mas comodo..


Re: їCуmo creo varios comandos? - DarNeell - 23.11.2014

Gracias amigos, verй que GM de ZCMD ahн para aprender un poco mбs o meno, saludos.


Respuesta: їCуmo creo varios comandos? - !R1Ch@rD! - 23.11.2014

si vas a usar ZCMD tienes que poner los comandos asн y dejalo fuera del callback public OnPlayerCommandText(playerid, cmdtext[])

pawn Код:
CMD:deagle(playerid,params[])
{
   GivePlayerWeapon(playerid, 24, 999);
   SendClientMessage(playerid, 0x00E40000, "Escogiste una degale");
   return 1;
    }

CMD:combate(playerid,params[])
{
   GivePlayerWeapon(playerid, 27, 999);
   SendClientMessage(playerid, 0x00E40000, "Escogiste una escopeta de combate");
   return 1;
}