need help with a command
#1

heres the command i need help with when i use it all it does in game is show nothing. like it working but there is no text


Код:
	if(strcmp(cmd, "/10-49", true) == 0)
	{
		  if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
			{
   			new String[256];
			  if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** LAFD Dispatch: Unit: #%d is Enroute to the scene. **", sendername, PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LAFD Dispatch: Engine: #%d is Enroute to the scene. **", sendername, PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LAFD Dispatch: Engine: #%d is Enroute to the scene. **", sendername, PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LAFD Dispatch: Engine: #%d is Enroute to the scene. **", sendername, PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LAFD Dispatch: EMS: #%d is Enroute to the scene. **", sendername, PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LAFD Dispatch: EMS: #%d is Enroute to the scene. **", sendername, PlayerInfo[playerid][pBadgeNumber]); }
   			SendRadioMessage(1, COLOR_DBLUE, String);
  			SendRadioMessage(4, COLOR_RED, String);
		}
		return 1;
	}
Reply
#2

Give this a try

pawn Код:
if (strcmp(cmd, "/10-49", true) == 0)
{
    if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
    {
        new string[128];
        if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** LAFD Dispatch: Unit: #%d is Enroute to the scene. **", PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LAFD Dispatch: Engine: #%d is Enroute to the scene. **", PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LAFD Dispatch: Engine: #%d is Enroute to the scene. **", PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LAFD Dispatch: Engine: #%d is Enroute to the scene. **", PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LAFD Dispatch: EMS: #%d is Enroute to the scene. **", PlayerInfo[playerid][pBadgeNumber]); }
        else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LAFD Dispatch: EMS: #%d is Enroute to the scene. **", PlayerInfo[playerid][pBadgeNumber]); }
        SendRadioMessage(1, COLOR_DBLUE, string);
        SendRadioMessage(4, COLOR_RED, string);
    }
    return 1;
}
If it doesn't work, post your "SendRadioMessage" function.
Reply
#3

that was the 2nd thing i tried heres my sendradiomessage

Код:
public SendRadioMessage(member, color, string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		  if(PlayerInfo[i][pMember] == member || PlayerInfo[i][pLeader] == member)
		  {
				SendClientMessage(i, color, string);
			}
		}
	}
}
Reply
#4

@Anwix, why 256?

@D_Clark has SendRadioMessage worked in any other commands?
Reply
#5

ok it seems this change new string[128]; fixed it thnx
Reply
#6

Quote:
Originally Posted by Daren_Jacobson
@Anwix, why 256?

@D_Clark has SendRadioMessage worked in any other commands?
What 256, i set the string to 128.
Reply
#7

Oh sorry, I had them backwards, my bad.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)