I'm having problems making a /richlist command for IRC.
#1

I'm having problems with creating a /richlist command for my IRC

The command looks like this:

pawn Код:
IRCCMD:richlist(botid, channel[], user[], host[], params[]) {
    if (IRC_IsHalfop(botid, channel, user))
    new msg[128], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1, HighestCash = -9999;
        IRC_GroupSay(gGroupID, channel, msg);
        format(msg, sizeof(msg), "Rich List:");
        IRC_GroupSay(gGroupID, channel, msg);

        for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x)) if (GetPlayerMoney(x) >= HighestCash) {
            HighestCash = GetPlayerMoney(x);
            Slot1 = x;
        }
        HighestCash = -9999;
        for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != Slot1) if (GetPlayerMoney(x) >= HighestCash) {
            HighestCash = GetPlayerMoney(x);
            Slot2 = x;
        }
        HighestCash = -9999;
        for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != Slot1 && x != Slot2) if (GetPlayerMoney(x) >= HighestCash) {
        HighestCash = GetPlayerMoney(x);
            Slot3 = x;
        }
        HighestCash = -9999;
        for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3) if (GetPlayerMoney(x) >= HighestCash) {
        HighestCash = GetPlayerMoney(x);
            Slot4 = x;
        }
        IRC_GroupSay(gGroupID, channel, msg);
        format(msg, sizeof(msg), "(%d) %s - $%d", Slot1,PlayerName2(Slot1),GetPlayerMoney(Slot1) );
        IRC_GroupSay(gGroupID, channel, msg);
        if(Slot2 != -1) {
            new msg[128];
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg, sizeof(msg), "(%d) %s - $%d", Slot2,PlayerName2(Slot2),GetPlayerMoney(Slot2) );
            IRC_GroupSay(gGroupID, channel, msg);
        }
        if(Slot3 != -1) {
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg, sizeof(msg), "(%d) %s - $%d", Slot3,PlayerName2(Slot3),GetPlayerMoney(Slot3) );
            IRC_GroupSay(gGroupID, channel, msg);
        }
        if(Slot4 != -1) {
            IRC_GroupSay(gGroupID, channel, msg);
            format(msg, sizeof(msg), "(%d) %s - $%d", Slot4,PlayerName2(Slot4),GetPlayerMoney(Slot4) );
            IRC_GroupSay(gGroupID, channel, msg);
        }
    return 1;
}
This is the errors I get:

pawn Код:
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(34041) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(34041) : error 017: undefined symbol "msg"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(34041) : warning 215: expression has no effect
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(34041) : error 001: expected token: ";", but found "]"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(34041) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Line 34041:

pawn Код:
new msg[128], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1, HighestCash = -9999;
Reply


Messages In This Thread
I'm having problems making a /richlist command for IRC. [+++REP!!!!!] - by OleKristian95 - 07.04.2012, 12:37
Re: I'm having problems making a /richlist command for IRC. - by OleKristian95 - 07.04.2012, 23:52
Re: I'm having problems making a /richlist command for IRC. - by OleKristian95 - 08.04.2012, 22:04

Forum Jump:


Users browsing this thread: 1 Guest(s)