strcmp issue
#7

It's totally wrong. At the moment I am too tired to explain it all, just try this:
pawn Код:
if(strcmp(cmd, "/set", true) == 0)
{
    new string[128], opt[20];
    if(PlayerInfo[playerid][pAdmin >= 3)
    {
        if(sscanf(params, "us[20]i", id, opt, Value))
        {
            if(strlen(opt) == 0)
            {
                        SendClientMessage(playerid, -1, "SYNTAX: /set [Playerid] [Option] [Value]");
                        SendClientMessage(playerid, -1, "OPTIONS: Army, Origin, Interior, Skin, ArmyRank, Money, Age");
                        SendClientMessage(playerid, -1, "OPTIONS: Armor, Cirtual WorldPlayinghours, Score, Experience");
            }
            else
            if(strcmp(opt, "army", true) == 0)
            {
                            format(string, sizeof(string), "You have set %s's Army to %d.", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            SavePlayerDat(id);
                            PlayerInfo[id][pArmy] = Value;
                            PlayerInfo[id][pArmyRank] = 1;
            }
        }
    }
    return 1;
}
Edit: Just tell me if it works. I didn't do this properly, but if it works, I'll change it.
Reply


Messages In This Thread
strcmp issue - by nmader - 01.05.2012, 21:21
Re: strcmp issue - by 2KY - 01.05.2012, 21:23
Re: strcmp issue - by nmader - 01.05.2012, 21:26
Re: strcmp issue - by FalconX - 01.05.2012, 21:27
Re: strcmp issue - by Ash. - 01.05.2012, 21:30
Re: strcmp issue - by 2KY - 01.05.2012, 21:32
Re: strcmp issue - by Biesmen - 01.05.2012, 21:37
Re: strcmp issue - by FalconX - 01.05.2012, 21:52

Forum Jump:


Users browsing this thread: 1 Guest(s)