fast commands
#1

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

any one helps pls?
Reply
#3

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

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

i am using OnPlayerCommandText and i am not using SendTeamMessage i am using gTeam[playerid]
Reply
#6

help pls
Reply
#7

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;
}
Reply
#8

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

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;
}
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)