SA-MP Forums Archive
[Ayuda] Comando MP - 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: [Ayuda] Comando MP (/showthread.php?tid=314515)



[Ayuda] Comando MP - ronaldfa - 30.01.2012

Hola Amigos Tengo Un Problema =S quiero implementar el comando /pm pero tengo el siguente error

este es mi comando :

PHP код:
if(strcmp(cmd"/pm"true) == || strcmp(cmd"/mp"true) == 0)
   {
       if(
IsPlayerConnected(playerid))
       {
           if(
gPlayerLogged[playerid] == 0) return Message(playeridCOLOR_RED"Logeate, porfavor!");
         
tmp strtok(cmdtextidx);
         if(!
strlen(tmp)) return Message(playeridCOLOR_RED"Utiliza: /PM [Player ID] [Texto]");
         
giveplayerid ReturnUser(tmp);
         if (
IsPlayerConnected(giveplayerid))
         {
             if(
giveplayerid != INVALID_PLAYER_ID)
             { 
y estos son los errores que me aparecen

Код:
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(209) : warning 225: unreachable code
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(235) : error 004: function "BorrarAuto" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(239) : warning 225: unreachable code
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(258) : error 017: undefined symbol "strtok"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(258) : error 033: array must be indexed (variable "cmd")
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(263) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(269) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(282) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(294) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(308) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(321) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(331) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(336) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(366) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(373) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(377) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(380) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(381) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(382) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(383) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(384) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(387) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(388) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(389) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(390) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(391) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(392) : error 079: inconsistent return types (array & non-array)
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(395) : error 004: function "SendPlayerFormattedText" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.



Respuesta: [Ayuda] Comando MP - TiNcH010 - 30.01.2012

No cerraste?
Tenes que cerrar las llaves:
pawn Код:
if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/mp", true) == 0)
{
       if(IsPlayerConnected(playerid))
       {
         if(gPlayerLogged[playerid] == 0) return Message(playerid, COLOR_RED, "Logeate, porfavor!");

         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp)) return Message(playerid, COLOR_RED, "Utiliza: /PM [Player ID] [Texto]");

         giveplayerid = ReturnUser(tmp);
         if (IsPlayerConnected(giveplayerid))
         {
             if(giveplayerid != INVALID_PLAYER_ID)
             {
             // Aca va la acciуn del cmd.
             }
          else
          {
          // Jugador no conectado.
          return 1;
          }
          else
          {
          // Jugador Invбlido.
          return 1;
          }
          else
          {
          // Jugador no conectado (del que ejecuto el cmd).
          return 1;
          }
return 1;
}



Respuesta: [Ayuda] Comando MP - ronaldfa - 30.01.2012

me sale el mismo error -.-


Respuesta: [Ayuda] Comando MP - adrianxd - 30.01.2012

Te dejo este esta mejor

con este podras mirar si te quiren hacer spam en el server por mp

claro si lo confoguras con tu sistema de admins

velo

pawn Код:
if(strcmp(cmd, "/pm", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   No as logiado todavia.");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USA: /pm [ID] [text]");
                return 1;
            }
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Usted esta callado No puede hablar.");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[128];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USE: /pm [ID] [text]");
                            return 1;
                        }
                        format(string, sizeof(string), "* PM from %s(ID: %d): %s.", sendername, playerid, (result));
                        SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                        format(string, sizeof(string), "* PM to %s(ID: %d): %s.", giveplayer, giveplayerid, (result));
                        SendClientMessage(playerid,  COLOR_YELLOW, string);
                        format(string, sizeof(string), "* PM from %s(ID: %d) to %s(ID: %d): %s.", sendername, playerid, PlayerName(giveplayerid), giveplayerid,  (result));
                        ABroadCast(COLOR_ORANGE, string, 1);
                        return 1;
                }
            }
            else
            {
                    format(string, sizeof(string), "   %d Este jugador no est activo.", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
            }
        }
        return 1;
    }
a y te dejo los defines para los colores

pawn Код:
#define COLOR_GREEN      0x33AA33AA
#define COLOR_GRAD2      0xBFC0C2FF
#define COLOR_ORANGE     0xF97804FF
#define COLOR_YELLOW     0xFFFF00AA



Respuesta: [Ayuda] Comando MP - ronaldfa - 30.01.2012

y como ago eso e.e osea como lo configuro con el sistema de admin


Respuesta: [Ayuda] Comando MP - [Nikk] - 30.01.2012

proba asi:
pawn Код:
if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/mp", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if(gPlayerLogged[playerid] == 0) return Message(playerid, COLOR_RED, "Logeate, porfavor!");
         {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp)) return Message(playerid, COLOR_RED, "Utiliza: /PM [Player ID] [Texto]");
         {
         giveplayerid = ReturnUser(tmp);
         if (IsPlayerConnected(giveplayerid))
         {
             if(giveplayerid != INVALID_PLAYER_ID)
             {
             //accion del cmd
             }
         }
         }
         }
       }
    return 1;
    }



Respuesta: [Ayuda] Comando MP - adrianxd - 30.01.2012

igual el de nikk sirve
suerte


Respuesta: [Ayuda] Comando MP - ronaldfa - 30.01.2012

Quote:

C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(209) : warning 225: unreachable code
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(239) : warning 225: unreachable code
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(49 : error 017: undefined symbol "gPlayerLogged"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(49 : warning 215: expression has no effect
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(49 : error 001: expected token: ";", but found "]"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(49 : error 029: invalid expression, assumed zero
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(49 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

me sale eso ahora :S


Respuesta: [Ayuda] Comando MP - adrianxd - 30.01.2012

as esto

pawn Код:
new gPlayerLogged[MAX_PLAYERS];



Respuesta: [Ayuda] Comando MP - ronaldfa - 30.01.2012

Quote:

C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(499) : error 017: undefined symbol "Message"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(501) : error 017: undefined symbol "tmp"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(502) : error 017: undefined symbol "tmp"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(502) : error 017: undefined symbol "Message"
C:\Users\RONALD\Desktop\RONALD\GM BY RONALD\gamemodes\lvdm.pwn(504) : error 017: undefined symbol "ReturnUser"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

=( ayuda