#1

Ok i have this Team chat code, but it doesn't seem to send to the team and it's realy annoying i can't seem to fix it. i don't know what i did wrong.

Код:
 if(!strcmp(cmdtext,"/d", true,2)) {
    if(!strlen(cmdtext[2])) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /d [text] (lspd chat)");
    if(gTeam[playerid] != TEAM_LSPD) return SendClientMessage(playerid, 0xAFAFAFAA, "You must be a cop to use this command!");
    new playername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "* *Officer [%s]: %s, over", playername, cmdtext[2]);
    for(new i = 0; i < MAX_PLAYERS; i++) {
// LSPD TEAM CHAT
      if(gTeam[playerid] == TEAM_LSPD) {
        SendClientMessage(playerid, COLOR_GOLD, string);
      }
      return 1;
    }
    return 0;
  }
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/d", true,2)) {
    if(!strlen(cmdtext[2])) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /d [text] (lspd chat)");
    if(gTeam[playerid] != TEAM_LSPD) return SendClientMessage(playerid, 0xAFAFAFAA, "You must be a cop to use this command!");
    new playername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "* *Officer [%s]: %s, over", playername, cmdtext[2]);
    for(new i = 0; i < MAX_PLAYERS; i++) {
// LSPD TEAM CHAT
      if(gTeam[i] == TEAM_LSPD) {
        SendClientMessage(i, COLOR_GOLD, string);
      }
      return 1;
    }
    return 0;
  }
That should do the trick.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)