24.03.2017, 17:10
Quote:
You do NOT need the second query. At all. You already have the entire result set from the first query. Remove the second query and replace 0 with x in the cache_get_value statements.
|
Factions table:
Код:
ID | NAME -------------- 0 No // I don't need a ID 0 1 Goverment 2 LSPD 4 LSMD
Код:
CMD:factlist(playerid, params[]) { if(!AdminOnDuty(playerid) && pInfo[playerid][pAdmin] >= 6) return SendClientMessage(playerid, -1, NODUTY); SendClientMessage(playerid, ORANGE_ADMIN, "Factions:"); for(new x=1; x<=TotalFaccs; x++) { new string[500]; format(string, sizeof(string), "ID %d: %s", x, fInfo[x][fName]); SendClientMessage(playerid, ORANGE_ADMIN, string); } return 1; }
Factions:
1. Goverment
2. LSPD
3. No
And I have no clue why. I know that the deleted row it's giving me some troubles, but I want a dynamic faction system so I must be able to delete a row and not screw up the whole code :P