Radio Issue
#1

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

http://pastebin.com/m73b59f63

Try that one
Reply
#3

nope,still giving me unknown command
Reply
#4

Upload your whole OnPlayerCommandText callback to pastebin.com please .
Reply
#5

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.
Reply
#6

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

ya.... lol

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)