Help with command
#1

This is the command
pawn Код:
if(strcmp(cmd, "/senate", true) == 0)
    {
        if(PlayerInfo[playerid][pSenate] == 0)
        {
            SendClientMessage(playerid, TEAM_CYAN_COLOR, "You are to Low Rank in The Senate!");
            return 1;
        }
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        new result[128];
        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, "USAGE: /senate [senate annouce]");
            return 1;
        }
        if(PlayerInfo[playerid][pSenate] == 1) { format(string, sizeof(string), "Senator %s Say: %s.",sendername, result);}
        else if(PlayerInfo[playerid][pSenate] == 2) { format(string, sizeof(string), "Archelon Senator %s Say: %s.",sendername, result);}
        else if(PlayerInfo[playerid][pSenate] == 3) { format(string, sizeof(string), "Corleone Senator %s Say: %s.",sendername, result);}
        else if(PlayerInfo[playerid][pSenate] == 4) { format(string, sizeof(string), "Advisor Senator %s Say: %s.",sendername, result);}
        else if(PlayerInfo[playerid][pSenate] == 5) { format(string, sizeof(string), "GodFather's R.H %s Say: %s.",sendername, result);}
        else if(PlayerInfo[playerid][pSenate] == 6) { format(string, sizeof(string), "GodFather %s Say: %s.",sendername, result);}
        else if(PlayerInfo[playerid][pSenate] == 7) { format(string, sizeof(string), " [Unknown] [Criminal Senate] (radio): %s, over.", result);}
        SendFamilyMessage(PlayerInfo[playerid][pSenate], 0x7BDDA5AA, string);
        new y, m, d;
        new h,mi,s;
        getdate(y,m,d);
        gettime(h,mi,d);
        format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (radio): (%s)",d,m,y,h,mi,s, result);
        RadioChatLog(string);
        return 1;
    }
the problem is that the message isnt sent out to the "senate" it isnt sent out at all! what am i doing wrong?
Reply
#2

Have you got the stock quick at hand for the SendFamilyMessage, bud?
Reply
#3

Show us your SendFamilyMessage Public/Stock

But ill build you a custom one anyway, check your inbox in the next few hours - [Myself busy coding my own things atm]
Reply
#4

pawn Код:
public SendFamilyMessage(family, color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pMember] == family || PlayerInfo[i][pLeader] == family)
            {
                if(!gFam[i])
                {
                    SendClientMessage(i, color, string);
                }
            }
        }
    }
}
Reply
#5

What is the gFam variable to do with? It may stop the message sending as it doesn't meet that condition therefore not sending...
Reply
#6

Quote:
Originally Posted by LiamM
Посмотреть сообщение
What is the gFam variable to do with? It may stop the message sending as it doesn't meet that condition therefore not sending...
Please Give us the gFam line please ^ " " " "
Reply
#7

It sends for all the factions if i put a faction, but this i want for to be the "Senate" radio. it is like a rank that can be given to those who should have it.
Reply
#8

Excuse me Post the Full Script and its stock and if there is any error show it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)