/radio
#1

http://pastebin.com/m33893139

I want do make it easy.
If i compile, then my Pawno crashes. Problem is "/raadio".
Reply
#2

pawn Код:
if (PlayerInfo[playerid][pLeader] != 0)
            {
                teamnumber = PlayerInfo[playerid][pLeader];
            }
            else
            {
            if (PlayerInfo[playerid][pMember] != 0)
            {
                teamnumber = PlayerInfo[playerid][pMember];
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Sa pole orginatsioonides!");
                return 1;
            }
Might be the brackets, as you're using so many in excess, with some missing, see what happens whilst replacing this code with your current.
Reply
#3

Did'nt helped, crashing still.
// Fixed.

Код:
	if(strcmp(cmd,"/raadio",true)==0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pLeader] != 0)
			{
				teamnumber = PlayerInfo[playerid][pLeader];
			}
			else
			{
				if (PlayerInfo[playerid][pMember] != 0)
				{
					teamnumber = PlayerInfo[playerid][pMember];
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "Sa pole orginatsioonides!");
					return 1;
				}
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KASUTAMINE: (/r)aadio [radio chat]");
				return 1;
			}
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if (IsPlayerConnected(i))
				{
					format(string, sizeof(string), "(( %s: %s ))",sendername, result);
					SendRadioMessage(teamnumber, TEAM_RADIO_COLOR, string);
					printf("%s", string);
					format(string, sizeof(string), "* %s kasutab raadiosaatjat.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				}
			}
		}
		return 1;
	}
Код:
C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20217) : error 017: undefined symbol "teamnumber"
C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20217) : warning 215: expression has no effect
C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20223) : error 017: undefined symbol "teamnumber"
C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20223) : warning 215: expression has no effect
C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20255) : error 017: undefined symbol "teamnumber"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#4

Fixed all, but, i type /raadio Tekst, then says 3x more... :/

Код:
	if(strcmp(cmd,"/raadio",true)==0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    new teamnumber;
			if (PlayerInfo[playerid][pLeader] != 0)
			{
				teamnumber = PlayerInfo[playerid][pLeader];
			}
			else
			{
				if (PlayerInfo[playerid][pMember] != 0)
				{
					teamnumber = PlayerInfo[playerid][pMember];
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "Sa pole orginatsioonides!");
					return 1;
				}
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KASUTAMINE: (/r)aadio [radio chat]");
				return 1;
			}
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if (IsPlayerConnected(i))
				{
					format(string, sizeof(string), "(( %s: %s ))",sendername, result);
					SendRadioMessage(teamnumber, TEAM_RADIO_COLOR, string);
					printf("%s", string);
					format(string, sizeof(string), "* %s kasutab raadiosaatjat.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				}
			}
		}
		return 1;
	}
Reply
#5

100% will work now

http://pastebin.com/m305d889
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)