/c <text>
#1

I'm trying to make a code, for group chat, for everyone. And it gets the team of the player who typed, and send for all other players of his team (1 command for any teams), but that crashs, and I've tried always
pawn Код:
dcmd_c(playerid,params[])
{
    new string[128];
    new name[30]; GetPlayerName(playerid, name, 30);
    if(sscanf(params, "s[128]", params[2])) return SendClientMessage(playerid, cinza, "/c <texto>");
    format(string,sizeof(string),"%s [ID:%d]: %s",name,playerid,params[2]);
    foreach (Player, i)
    {
     
      if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
      {
        SendClientMessage(i, agua, string);
      }
    }
    return 1;
}
DCMD + SSCANF
Reply
#2

I think that this code can solve your problem:


pawn Код:
dcmd_c(playerid,params[])
{
    new string[128],
    new string2[128];
    new name[30];
    GetPlayerName(playerid, name, 30);
    if (sscanf(params, "s",string2)) SendClientMessage(playerid, cinza, "/c <texto>");
    format(string, sizeof(string),"%s [ID:%d]: %s", name, playerid, string2);
    foreach (Player, i)
    {
      if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
      {
        SendClientMessage(i, agua, string);
      }
    }
    return 1;
}

I hope that i have helped
Reply
#3

Quote:
Originally Posted by rjjj
Посмотреть сообщение
I think that this code can solve your problem:


pawn Код:
dcmd_c(playerid,params[])
{
    new string[128],
    new string2[128];
    new name[30];
    GetPlayerName(playerid, name, 30);
    if (sscanf(params, "s",string2)) SendClientMessage(playerid, cinza, "/c <texto>");
    format(string, sizeof(string),"%s [ID:%d]: %s", name, playerid, string2);
    foreach (Player, i)
    {
      if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
      {
        SendClientMessage(i, agua, string);
      }
    }
    return 1;
}

I hope that i have helped
Vlws ae cara
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)