SA-MP Forums Archive
fast commands - 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)
+--- Thread: fast commands (/showthread.php?tid=423384)



fast commands - ethhackerman - 17.03.2013

hi guys i need fast team masseges example :
/11 : [team]roger that
and i am using gTeam
thanks


Re: fast commands - ethhackerman - 18.03.2013

any one helps pls?


Re: fast commands - Xeiss - 18.03.2013

Are you using any command processor like ZCMD, or "OnPlayerCommandText"?


Re: fast commands - cotyzor - 18.03.2013

You can make commands like "/11" ; "/12" or "/13" and use the "SendTeamMessage()" function or something like that, created by you!


Re: fast commands - ethhackerman - 18.03.2013

i am using OnPlayerCommandText and i am not using SendTeamMessage i am using gTeam[playerid]


Re: fast commands - ethhackerman - 18.03.2013

help pls


Re: fast commands - erminpr0 - 18.03.2013

pawn Код:
stock SendTeamMessage(team, color, message)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
          if(gTeam[i] == team)
          {
               SendClientMessage(i, color, message);
          }
    }
}
And a Command:

pawn Код:
if (strcmp("/team", cmdtext, true, 10) == 0)
{
     new idx;
     if(!strlen(strtok(cmdtext, idx)))
     {
           SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /team [text]");
           return 1;
     }
     else
     {
           new teamstring[128];
           new pName[MAX_PLAYER_NAME];
           GetPlayerName(playerid, pName, sizeof(pName));
           format(teamstring, 128, "(T): %s: %s", pName, idx);
           SendTeamMessage(gTeam[playerid], 0x00FF00AA, teamstring);
           return 1;
      }
      return true;
}



Re: fast commands - ethhackerman - 18.03.2013

-_- dude i want /11 to send team msg :rogerthat


Re: fast commands - Misiur - 18.03.2013

Use your brain! It doesn't hurt.

pawn Код:
stock SendTeamMessage(team, color, message)
{
    for(new i = 0; i != MAX_PLAYERS; ++i)
    {
          if(gTeam[i] == team)
          {
               SendClientMessage(i, color, message);
               break;
          }
    }
}
pawn Код:
if(!strcmp("/11", cmdtext, true, 3))
{
    new teamstring[129];
    format(teamstring, sizeof teamstring, "[Team %d]: Roger that!", gTeam[playerid]);
    SendTeamMessage(gTeam[playerid], 0x00FF00AA, teamstring);
    return 1;
}



Re: fast commands - ethhackerman - 19.03.2013

ahh... please use ur brain 2 ...
F:\samp2\gamemodes\eth.pwn(15 : error 035: argument type mismatch (argument 3)
F:\samp2\gamemodes\eth.pwn(152) : warning 203: symbol is never used: "message"
F:\samp2\gamemodes\eth.pwn(2003) : error 035: argument type mismatch (argument 3)