SA-MP Forums Archive
Radio Issue - 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: Radio Issue (/showthread.php?tid=109102)



Radio Issue - [LCG]TANKER - 17.11.2009

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

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]");
        }
       
    }



Re: Radio Issue - LarzI - 17.11.2009

http://pastebin.com/m73b59f63

Try that one


Re: Radio Issue - [LCG]TANKER - 17.11.2009

nope,still giving me unknown command


Re: Radio Issue - LarzI - 17.11.2009

Upload your whole OnPlayerCommandText callback to pastebin.com please .


Re: Radio Issue - [LCG]TANKER - 18.11.2009

http://pastebin.com/m56968e25
http://pastebin.com/m1afd2d45

also getting this now :P

Код:
C:\Documents and Settings\Mark\Desktop\SA-MP .3a Server\gamemodes\desertwindbase.pwn(243) : warning 209: function "SendArmyMessage" should return a value
C:\Documents and Settings\Mark\Desktop\SA-MP .3a Server\gamemodes\desertwindbase.pwn(245) : warning 209: function "SendRebalMessage" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: Radio Issue - _Vortex - 18.11.2009

http://pastebin.com/m23033822

Try that for OnPlayerCommandText. All I did was make OnPlayerCommandText return 0 instead of 1, try it.

As for your errors, Make your SendArmy/RebalMessage return 1 somewhere, I'm not sure where, all the brackets are confusing me xD


Re: Radio Issue - [LCG]TANKER - 18.11.2009

ya.... lol

i got my own little way of doing it and pawno dosent like it eather lmao


Re: Radio Issue - [LCG]TANKER - 18.11.2009

ok so now .... i got everything mainly fixed, the problem now is if i use "/r " it shows "*Radio:Tanker305: " if i try "/r hi!!!!" i get a command unknown so it is somewhere in in that little section not sure where

http://pastebin.com/m205320ad


srry for doublepost