Just tell what is wrong here'
#1

It's a command, which detects player team and send the message for all players which are of his team

pawn Код:
dcmd_x(playerid,params[])
{
   new text[64];
   new name[30];
   new string[128];
   GetPlayerName(playerid, name, 30);
   if(sscanf(params,"s[64]",text)) SendClientMessage(playerid, cinza, "/x <texto>");
   if(GetPlayerTeam(playerid) == 0) SendClientMessage(playerid, cinza, "Vocк nгo tem grupo ainda");
   format(string,sizeof(string),"CHAT: %s [ID: %d]: %s",name,playerid,params[2]);
   foreach (Player, i)
   {
      if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
      {
         SendClientMessage(i,agua,string);
      }
   }
   return 1;
}

It just returns nothing o.o
Reply
#2

pawn Код:
if(sscanf(params,"s[64]",text)) SendClientMessage(playerid, cinza, "/x <texto>");
Is not necessary, as you have only one param to pass.
Remove the sscanf line, and replace your format function with this one:

pawn Код:
format(string, sizeof(string), "CHAT: %s [ID: %d]: %s", name, playerid, params);
Then it should work.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
if(sscanf(params,"s[64]",text)) SendClientMessage(playerid, cinza, "/x <texto>");
Is not necessary, as you have only one param to pass.
Remove the sscanf line, and replace your format function with this one:

pawn Код:
format(string, sizeof(string), "CHAT: %s [ID: %d]: %s", name, playerid, params);
Then it should work.
At all worked. Thx. But I think problem was on foreach, cuz I replaced for the normal:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)