[Ajuda] Radio para Team - /r
#1

opaa firme ? to tentando criar um comando de radio para o time й travei :/

pawn Код:
CMD:r(playerid, params[])
    {
    new Classes[120];
    new string[128];
    {

        if(gClasse[playerid] == SOLDADO) Classes = "assalto";
        if(gClasse[playerid] == SNIPER) Classes = "sniper";
        if(gClasse[playerid] == ENGENHEIRO) Classes = "engenheiro";
        if(gClasse[playerid] == PILOTO) Classes = "piloto";
        if(gClasse[playerid] == MEDICO) Classes = "suporte";
    }
    String("[RADIO][%s][%d]%s: %s", Classes[playerid],playerid,nome(playerid),params);
    foreach(Player,i)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid))
    {
    SendClientMessage(i,cor_verdeclaro,string);
    }
    }
    }
    return 1;
}
й ta dando erro

pawn Код:
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : error 017: undefined symbol "String"
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6419) : warning 219: local variable "i" shadows a variable at a preceding level
o que estб errado ? jб tentei inumeras vezes... talvez seja atй uma coisa simples que eu nem percebi '-'
Reply
#2

PHP код:
CMD:r(playeridparams[])
    {
    new 
Classes[120];
    new 
String[128];
    {

        if(
gClasse[playerid] == SOLDADOClasses "assalto";
            if(
gClasse[playerid] == SNIPERClasses "sniper";
        if(
gClasse[playerid] == ENGENHEIROClasses "engenheiro";
        if(
gClasse[playerid] == PILOTOClasses "piloto";
         if(
gClasse[playerid] == MEDICOClasses "suporte";
    }
    
String("[RADIO][%s][%d]%s: %s"Classes[playerid],playerid,nome(playerid),params);
    foreach(
Player,i)
    {
    for(new 
0MAX_PLAYERSi++)
    {
    if(
IsPlayerConnected(i) && GetPlayerTeam(playerid) == GetPlayerTeam(playerid))
    {
    
SendClientMessage(i,cor_verdeclaro,string);
    }
    }
    }
    return 
1;

Tenta la
Reply
#3

pawn Код:
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : error 012: invalid function call, not a valid address
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : error 001: expected token: ";", but found ")"
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : error 029: invalid expression, assumed zero
C:\Users\Daniel\Desktop\Battlefield Veterans\gamemodes\TDM.pwn(6416) : fatal error 107: too many error messages on one line
deu erro
Reply
#4

passa essa linha
Reply
#5

pawn Код:
String("[RADIO][%s][%d]%s: %s", Classes[playerid],playerid,nome(playerid),params);
Reply
#6

PHP код:
CMD:r(playeridparams[])
{
    new 
Classes[24], string[128];
    if(
gClasse[playerid] == SOLDADOClasses "assalto";
    if(
gClasse[playerid] == SNIPERClasses "sniper";
    if(
gClasse[playerid] == ENGENHEIROClasses "engenheiro";
    if(
gClasse[playerid] == PILOTOClasses "piloto";
    if(
gClasse[playerid] == MEDICOClasses "suporte";
    
format(stringsizeof(string), "[RADIO][%s][%d]%s: %s"Classesplayeridnome(playerid), params);
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid))
        {
            
SendClientMessage(i0x00FF80AAstring);
        }
    }
    return 
1;

Reply
#7

Obrigadu , +rep for all <3
Reply
#8

Eu ia dizer, faltou formatar a string e o outro nгo encontrei, mais mesmo assim seria seu erro.

Abraзos.
Reply
#9

Quote:
Originally Posted by matheusspohr
Посмотреть сообщение
Eu ia dizer, faltou formatar a string e o outro nгo encontrei, mais mesmo assim seria seu erro.

Abraзos.
Jб foi resolvido o matheusspohr [Huge Clucker: Posts 230, Reputation: 6]
Reply
#10

Bom, sу postei pelo simples fato de ele nгo encontrar o erro e acabar fazendo o menos em outros coses que ele desenvolver.

Abraзos.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)