SA-MP Forums Archive
Help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help. (/showthread.php?tid=106929)



Help. - Pinehole - 06.11.2009

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;
  }



Re: Help. - miokie - 06.11.2009

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.