17.11.2009, 20:31
not sure what i did wrong but it worked 1 time and that was about it, i did /r hi all i saw was this
*Radio:Tanker305:
then when i tryed it the next time it gave me unknown command, knowing me it is most likely a incredibly simple mistake i overlooked
*Radio:Tanker305:
then when i tryed it the next time it gave me unknown command, knowing me it is most likely a incredibly simple mistake i overlooked
pawn Код:
SendArmyMessage(color, text[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if (gTeam[i] == TEAM_ARMY)
{
SendClientMessage(i, color, text);
}
}
}
}
SendRebalMessage(color, text[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if (gTeam[i] == TEAM_REBAL)
{
SendClientMessage(i, color, text);
}
}
}
}
pawn Код:
if(strcmp(cmdtext , "/r", true) == 0)
{
if (gTeam[playerid] == TEAM_ARMY)
{
if ((strlen(cmdtext) >= 1)&&(strlen(cmdtext) <= 3))
{
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"*Radio: %s:%s",playername,cmdtext[128]);
SendArmyMessage(COLOR_RADIO, string);
}
else return SendClientMessage(playerid, 0xFFFF00AA, "Usage: /r [message]");
}
if (gTeam[playerid] == TEAM_REBAL)
{
if ((strlen(cmdtext) >= 1)&&(strlen(cmdtext) <= 3))
{
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"*Radio: %s:%s",playername,cmdtext[128]);
SendRebalMessage(COLOR_RADIO, string);
}
else return SendClientMessage(playerid, 0xFFFF00AA, "Usage: /r [message]");
}
}