Command Not Working
#1

pawn Код:
CMD:factioninfo(playerid, params[])
{
    new
    string[128], string2[256], id;
   
    if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "[Usage]: /factioninfo [factionID]");
    if(id < 1 || id > 10 ) return SCM(playerid, COLOR_LIGHTRED, "Invalid faction ID.");
   
    for(new f = 1;f < sizeof(FactionInfo);f++)
    {
        if(f == id)
        {
            SCM(playerid, COLOR_GREEN, "_______________________________"COL_WHITE"[FACTION INFO]"COL_GREEN"_______________________________");
            format(string, sizeof(string), "Name: %s", FactionInfo[id][fName]);
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(string, sizeof(string), "Members: %d", FactionInfo[id][fMembers]);
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(string2, sizeof(string2), "Information: %s", FactionInfo[id][fInformation]);
            SendClientMessage(playerid, COLOR_WHITE, string2);
            break;
        }
    }
    return 1;
}
Doesn't load real information. I suspect something is wrong with this line.
pawn Код:
if(f == id)
I want to loop through the 10 static factions and pick the one that matches the id I wrote in the command.
Reply


Messages In This Thread
Command Not Working - by Chrillzen - 28.02.2014, 18:56
Re: Command Not Working - by Konstantinos - 28.02.2014, 18:59
Re: Command Not Working - by Chrillzen - 28.02.2014, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)