/set script issue
#1

Alright, so I am making an admin command to set a player's stats. This is what I have so far to test it. It compiles with no errors or anything, but the minute I do /set it prompts the SYNTAX: /set [playerid] [option] [value], so I fill those out, and hit it again, and it shows them yet again. Here is the script:
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, VW, Playinghours, Score, Experience");
                }
                else
                {
                    if(strcmp(opt, "army", true) == 0)
                    {
                        SavePlayerDat(id);
                        PlayerInfo[id][pArmy] = Value;
                        PlayerInfo[id][pArmyRank] = 1;
                        if(Value == 1)
                        {
                            format(string, sizeof(string), "You have set %s's Army to the United States Military. (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Army to the United States Military. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 3)
                        {
                            format(string, sizeof(string), "You have set %s's Army to the Soviet Union. (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Army to the Soviet Union. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 2)
                        {
                            format(string, sizeof(string), "You have set %s's Army to the European Alliance. (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Army to the European Alliance. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 4)
                        {
                            format(string, sizeof(string), "You have set %s's Army to the Asian Military Forces. (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Army to the Asian Military Forces. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 5)
                        {
                            format(string, sizeof(string), "You have set %s's Army to the German Armed Forces. (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Army to the German Armed Forces. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 6)
                        {
                            format(string, sizeof(string), "You have set %s's Army to the Taliban. (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Army to the Taliban. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                    }
                    if(strcmp(opt, "origin", true) == 0)
                    {
                        SavePlayerDat(id);
                        PlayerInfo[id][pOrigin] = Value;
                        if(Value == 1)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to American (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to American. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 3)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to European (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to European. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 2)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to Russian (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to Russian. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 4)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to Asian (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to Asian. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 5)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to German (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to German. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 6)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to Taliban (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to Taliban. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                        else if(Value == 7)
                        {
                            format(string, sizeof(string), "You have set %s's Origin to Other (ID %d)", GetName(id), Value);
                            SendClientMessage(playerid, -1, string);
                            format(string, sizeof(string), "Administrator %s has set your Origin to Other. (ID %d)", GetName(playerid), Value);
                            SendClientMessage(id, -1, string);
                        }
                    }
                    if(strcmp(opt, "interior", true) == 0)
                    {
                        SetPlayerInterior(playerid, Value);
                    }
                    if(strcmp(opt, "skin", true) == 0)
                    {
                        SetPlayerSkin(playerid, Value);
                        SavePlayerDat(playerid);
                        format(string, sizeof(string), "You have set %s's skin to ID: %d", GetName(id), Value);
                        SendClientMessage(playerid, -1, string);
                        format(string, sizeof(string), "Administrator %s has set your skin to ID: %d", GetName(playerid), Value);
                        SendClientMessage(id, -1, string);
                    }
                    if(strcmp(opt, "armyrank", true) == 0)
                    {
                        new army;
                        PlayerInfo[playerid][pArmyRank] = Value;
                        SavePlayerDat(playerid);
                        format(string, sizeof(string), "You have set %s's army rank to %d", GetName(id), Value);
                        SendClientMessage(playerid, -1, string);
                        if(Value == 0)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (0)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 1)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (1)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 2)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (2)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 3)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (3)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 4)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (4)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 5)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (5)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 6)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (6)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 7)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (7)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 8)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (8)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 9)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (9)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 10)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (10)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 11)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (11)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 12)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (12)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 13)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (13)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 14)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (14)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 15)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (15)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 16)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (16)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 17)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (17)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 18)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (18)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 19)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (19)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 20)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (20)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 21)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (21)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 22)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (22)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 23)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (23)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                        if(Value == 24)
                        {
                            format(string, sizeof(string), "Administrator %s has set your army rank to %d (24)", GetName(playerid), ArmyInfo[army][RankName0]);
                            SendClientMessage(playerid, -1, string);
                        }
                    }
                    if(strcmp(opt, "money", true) == 0)
                    {
                        SetPlayerMoney(playerid, Value);
                        SavePlayerDat(playerid);
                        format(string, sizeof(string), "You have set %s's money to: $%d", GetName(id), Value);
                        SendClientMessage(playerid, -1, string);
                        format(string, sizeof(string), "Administrator %s has set your money to: $%d", GetName(playerid), Value);
                        SendClientMessage(id, -1, string);
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

Your checks were out of whack a bit? Try this
pawn Код:
if(strcmp(cmd, "/set", true) == 0)
{
    new string[128], opt[20];
    if(PlayerInfo[playerid][pAdmin] < 3) return 1;
    if(sscanf(params, "us[20]i", id, opt, Value))
    {
        SendClientMessage(playerid, -1, "SYNTAX: /set [Playerid] [Option] [Value]");
        SendClientMessage(playerid, -1, "OPTIONS: Army, Origin, Interior, Skin, ArmyRank, Money, Age");
        SendClientMessage(playerid, -1, "OPTIONS: Armor, VW, Playinghours, Score, Experience");
    }
    else
    {
        if(strcmp(opt, "army", true) == 0)
        {
            SavePlayerDat(id);
            PlayerInfo[id][pArmy] = Value;
            PlayerInfo[id][pArmyRank] = 1;
            if(Value == 1)
            {
                format(string, sizeof(string), "You have set %s's Army to the United States Military. (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Army to the United States Military. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 3)
            {
                format(string, sizeof(string), "You have set %s's Army to the Soviet Union. (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Army to the Soviet Union. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 2)
            {
                format(string, sizeof(string), "You have set %s's Army to the European Alliance. (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Army to the European Alliance. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 4)
            {
                format(string, sizeof(string), "You have set %s's Army to the Asian Military Forces. (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Army to the Asian Military Forces. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 5)
            {
                format(string, sizeof(string), "You have set %s's Army to the German Armed Forces. (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Army to the German Armed Forces. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 6)
            {
                format(string, sizeof(string), "You have set %s's Army to the Taliban. (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Army to the Taliban. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
        }
        if(strcmp(opt, "origin", true) == 0)
        {
            SavePlayerDat(id);
            PlayerInfo[id][pOrigin] = Value;
            if(Value == 1)
            {
                format(string, sizeof(string), "You have set %s's Origin to American (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to American. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 3)
            {
                format(string, sizeof(string), "You have set %s's Origin to European (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to European. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 2)
            {
                format(string, sizeof(string), "You have set %s's Origin to Russian (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to Russian. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 4)
            {
                format(string, sizeof(string), "You have set %s's Origin to Asian (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to Asian. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 5)
            {
                format(string, sizeof(string), "You have set %s's Origin to German (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to German. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 6)
            {
                format(string, sizeof(string), "You have set %s's Origin to Taliban (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to Taliban. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
            else if(Value == 7)
            {
                format(string, sizeof(string), "You have set %s's Origin to Other (ID %d)", GetName(id), Value);
                SendClientMessage(playerid, -1, string);
                format(string, sizeof(string), "Administrator %s has set your Origin to Other. (ID %d)", GetName(playerid), Value);
                SendClientMessage(id, -1, string);
            }
        }
        if(strcmp(opt, "interior", true) == 0)
        {
            SetPlayerInterior(playerid, Value);
        }
        if(strcmp(opt, "skin", true) == 0)
        {
            SetPlayerSkin(playerid, Value);
            SavePlayerDat(playerid);
            format(string, sizeof(string), "You have set %s's skin to ID: %d", GetName(id), Value);
            SendClientMessage(playerid, -1, string);
            format(string, sizeof(string), "Administrator %s has set your skin to ID: %d", GetName(playerid), Value);
            SendClientMessage(id, -1, string);
        }
        if(strcmp(opt, "armyrank", true) == 0)
        {
            new army;
            PlayerInfo[playerid][pArmyRank] = Value;
            SavePlayerDat(playerid);
            format(string, sizeof(string), "You have set %s's army rank to %d", GetName(id), Value);
            SendClientMessage(playerid, -1, string);
            if(Value == 0)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (0)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 1)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (1)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 2)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (2)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 3)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (3)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 4)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (4)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 5)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (5)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 6)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (6)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 7)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (7)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 8)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (8)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 9)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (9)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 10)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (10)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 11)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (11)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 12)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (12)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 13)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (13)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 14)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (14)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 15)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (15)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 16)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (16)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 17)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (17)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 18)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (18)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 19)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (19)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 20)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (20)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 21)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (21)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 22)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (22)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 23)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (23)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
            if(Value == 24)
            {
                format(string, sizeof(string), "Administrator %s has set your army rank to %d (24)", GetName(playerid), ArmyInfo[army][RankName0]);
                SendClientMessage(playerid, -1, string);
            }
        }
        if(strcmp(opt, "money", true) == 0)
        {
            SetPlayerMoney(playerid, Value);
            SavePlayerDat(playerid);
            format(string, sizeof(string), "You have set %s's money to: $%d", GetName(id), Value);
            SendClientMessage(playerid, -1, string);
            format(string, sizeof(string), "Administrator %s has set your money to: $%d", GetName(playerid), Value);
            SendClientMessage(id, -1, string);
        }
    }
    return 1;
}
PS You don't need that many if statements...
Reply
#3

Nope, same issue: When I do /states and include all the requirements, it will keep sending the SYNTAX message.
Reply
#4

So.. where are you getting these params? "if(sscanf(params, "us[20]i", id, opt, Value))"

Yeah, you're not.. Since you're not using ZCMD or DCMD, you'll have to use string tokening instead of sscanf.
Reply
#5

Well, the only reason I have not switched to ZCMD or DCMD is for one reason: I am not sure how to make it show if a command is unkown if it is not scripted.
Reply
#6

Change

pawn Код:
if(sscanf(params, "us[20]i", id, opt, Value))
to

pawn Код:
if(sscanf(cmdtext, "{s[128]}us[20]i", id, opt, Value))
since you aren't using ZCMD.
Reply
#7

Nathan Mader isnt it? Holla yo. Check ExG Forum ASAP!
Reply
#8

There is no params in OnPlayerCommandText replace params with cmdtext
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)