SA-MP Forums Archive
CHat Radio Team - 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: CHat Radio Team (/showthread.php?tid=136667)



CHat Radio Team - Lautaro_eb - 26.03.2010

Tengo Un Inconveniente .
Код:
  if (strcmp("/r",cmdtext, true, 10) == 0)
  {
  	new pname[MAX_PLAYER_NAME];
  new string[256];
  GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  format(string, sizeof(string), "[Radio] %s: %s", pname, cmdtext[3]);
  SendTeamMessage(playerid,COLOR_AQUA,string);
  return 1;
  }
Tengo Ya el Comando Pero La Verdad No Funciona como yo Esperava .
Cuando Pongo /r Text Me dice que el Comando No existe Pero Si Pongo / blalblala Y Luego escrivo /r Aparese Radio Honbu : Bla bla bla bla.
esper Respuestas gracias.


Re: CHat Radio Team - TheChaoz - 26.03.2010

no funciona ya que seсalaste que el comando debe tener 10 caracteres aca:
pawn Код:
if(strcmp("/r", cmdtext, true, 10) == 0)
cambialo por
pawn Код:
if(strcmp("/r", cmdtext, true) == 0)
y el problema dejaria de estar



Re: CHat Radio Team - Lautaro_eb - 26.03.2010

EL Poblema Persite.
Код:
  if(strcmp(cmdtext, "/r", true) == 0)
  {
  	new pname[MAX_PLAYER_NAME];
  new string[256];
  GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  format(string, sizeof(string), "[Radio] %s: %s", pname, cmdtext[3]);
  SendTeamMessage(playerid,COLOR_AQUA,string);
  return 1;
  }
Disculpa las molestias.


Re: CHat Radio Team - CristianTdj - 26.03.2010

pawn Код:
//Arriba de tu GM:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2])))))
pawn Код:
//En OnPlayerCommandText:
{
  //Bla bla bla
  dcmd(r, 1, cmdtext);
  return 0;
}
pawn Код:
dcmd_r(playerid, params[])
{
    new text[256], name[60];
    if(sscanf(params, "s", text)) SendClientMessage(playerid, 0xFFFF00FF, "USA: /R <texto>");
    else
    {
      new string[322];
      GetPlayerName(playerid, name, 60);
      format(string, 322, "(%s) (Radio): %s", name, text);
      for(new i=0;i<MAX_PLAYER;i++)
      {
        if(IsPlayerConnected(i))
        {
            if(gTeam[i] == gTeam[playerid])
            {
              SendClientMessage(i, 0xFF0080FF, string);
                }
            }
        }
    }
    return 1;
}
Me repatean los noobs que ni si quiera leen tutoriales buenos como este.


Re: CHat Radio Team - Zamaroht - 26.03.2010

Quote:
Originally Posted by CristianTdj
Me repatean los noobs que ni si quiera leen tutoriales buenos como este.
Si tanto te molesta no tenes por quй responder al topic. Si vas a responder o ayudar en algo hacelo con buena onda.
Tratemos de mantener un buen clima en el foro, si?

Y por favor ahora no se disvirtuen, y sigan con el tema.


Re: CHat Radio Team - Lautaro_eb - 26.03.2010

Poblema.
Код:
  
  public OnPlayerCommandText(playerid, cmdtext[])
  {
  return 1;
  }
  dcmd(r, 1, cmdtext);
  return 0;
}

dcmd_r(playerid, params[])
{
	new text[256];
	new name[60];
	if(sscanf(params, "s", text)) SendClientMessage(playerid, 0xFFFF00FF, "USA: /R <texto>");
	else
	{
	  new string[322];
	  GetPlayerName(playerid, name, 60);
	  format(string, 322, "(%s) (Radio): %s", name, text);
	  for(new i=0;i<MAX_PLAYER;i++)
	  {
	    if(IsPlayerConnected(i))
	    {
	    	if(gTeam[i] == gTeam[playerid])
	    	{
	    	  SendClientMessage(i, 0xFF0080FF, string);
				}
			}
		}
	}
	return 1;
}
Errores.
Код:
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(374) : error 017: undefined symbol "sscanf"
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(380) : error 017: undefined symbol "MAX_PLAYER"
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(393) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: CHat Radio Team - xenowort - 26.03.2010

Quote:
Originally Posted by Lautaro_eb
Poblema.
Код:
  
 public OnPlayerCommandText(playerid, cmdtext[])
 {
  return 1;
  }
 dcmd(r, 1, cmdtext);
  return 0;
}

dcmd_r(playerid, params[])
{
	new text[256];
	new name[60];
	if(sscanf(params, "s", text)) SendClientMessage(playerid, 0xFFFF00FF, "USA: /R <texto>");
	else
	{
	  new string[322];
	  GetPlayerName(playerid, name, 60);
	  format(string, 322, "(%s) (Radio): %s", name, text);
	  for(new i=0;i<MAX_PLAYER;i++)
	  {
	    if(IsPlayerConnected(i))
	    {
	    	if(gTeam[i] == gTeam[playerid])
	    	{
	    	  SendClientMessage(i, 0xFF0080FF, string);
				}
			}
		}
	}
	return 1;
}
Errores.
Код:
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(374) : error 017: undefined symbol "sscanf"
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(380) : error 017: undefined symbol "MAX_PLAYER"
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(393) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
definistes sscanf



Re: CHat Radio Team - Lautaro_eb - 26.03.2010

Disculpa Ya lo Defini Pero Me Tira dos errores haora.
Код:
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(374) : error 033: array must be indexed (variable "text")
D:\Lautaro\Server samp 0.3a\gamemodes\GI.pwn(380) : error 017: undefined symbol "MAX_PLAYER"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: CHat Radio Team - xenowort - 26.03.2010

un error es que una cadena es demasiada grande.Por eso


Re: CHat Radio Team - Lautaro_eb - 26.03.2010

Nose como se Soluciona eso .