Strcmp Help
#3

pawn Код:
CMD:factioninfo(playerid, params[])
{
    new string[128], factionname[32], success = -1;
    if(sscanf(params, "s[32]", factionname)) return SendClientMessage(playerid, cred, "USAGE: /factioninfo [factionname]");
    for(new i = 0; i <= Total_Factions_Created; i++)
    {
        if(!strcmp(factionname, fInfo[i][Name], true))
        {
            SendClientMessage(playerid, cwhite, "================Faction Info================");
            format(string, sizeof(string), "Faction Name: %s", fInfo[i][Name]);
            SendClientMessage(playerid, cwhite, string);
            format(string, sizeof(string), "Faction ID: %d", i);
            SendClientMessage(playerid, cwhite, string);
            success = i;
            break;
        }
    }
    if(success == -1) return SendClientMessage(playerid, -1, "this faction doesn't exist!");
    return 1;
}
enjoy any feedback would be appreciated!
Reply


Messages In This Thread
Strcmp Help - by Joshayersm - 07.10.2014, 11:37
Re: Strcmp Help - by Vince - 07.10.2014, 12:37
Re: Strcmp Help - by Stanford - 07.10.2014, 15:03
Re: Strcmp Help - by Joshayersm - 07.10.2014, 20:56

Forum Jump:


Users browsing this thread: 1 Guest(s)