Command help
#1

I have a faction system which each faction has 9 ranks, each one with their proper title.

rank 1: Trial
rank 2: Testing
rank 3: Underboss

etc.

Since i don't wanna create 9 commands to edit each rank, i did in this way:

pawn Код:
CMD:fazione(playerid, params[])
{
    if (Player[playerid][AccountLevel] < 5) return 0;

    new factionname[30], newrankname[30], rank, query[200];

    if(sscanf(params, "s[30]ds[30]", factionname, rank, newrankname)) return SCM(playerid, COLOR_LIGHTRED, "* [USAGE]: /fazione [faction name] [rank to edit] [new rank name]");

    format(query, sizeof(query), "UPDATE `Factions` SET `Name` = '%s', Rank1 = '%s'", factionname, newrankname);
    mysql_tquery(g_SQL, query);
    return 1;
}
I know the above query is totally wrong, but i can't go forward. Basically an admin should do /fazione faction name - rank to edit (1-9) - new rank name

So imagine i have a LSPD faction and i want to edit rank 2, i wanna set rank 2 title to: Test

How i can do it with params? I can't manage to get it working.
Reply


Messages In This Thread
Command help - by KinderClans - 27.09.2018, 11:04
Re: Command help - by Dayrion - 27.09.2018, 11:17
Re: Command help - by KinderClans - 27.09.2018, 12:55
Re: Command help - by AlfaSufaIndo - 27.09.2018, 12:59
Re: Command help - by Dayrion - 27.09.2018, 13:07

Forum Jump:


Users browsing this thread: 3 Guest(s)