31.03.2012, 15:14
PHP код:
CMD:r(playerid, params[])
{
new idx,tmp[32];
new string[256];
tmp = strtok(params, idx);
new length = strlen(params);
while ((idx < length) && (params[idx] <= ' '))
{
idx++;
}
new offset = idx;
new text[64];
while (( idx < length) && ((idx - offset) < (sizeof(text) - 1)))
{
text[idx - offset] = params[idx];
idx++;
}
text[idx - offset] = EOS;
if(!strlen(text))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /radio [text]");
return 1;
}
if(gTeam[playerid] == TEAM_GROVE && PlayerInfo[playerid][pTeam] == 1) // this will see if he is in a Team
{
if(gTeam[playerid] == TEAM_GROVE) // so he is Grove
{
format(string, sizeof(string), "[TEAM-CHAT]%s Says : ", PlayerName[playerid], text); // will send the message
SendTeamMessage(TEAM_GROVE, COLOR_BLUE, string); // will give the team message in the color BLUE
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"You are not a part of the Grove team!.");
}
return 1;
}
![Cheesy](images/smilies/biggrin.png)