27.09.2018, 11:04
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:
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.
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;
}
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.