16.10.2012, 14:34
I have this command:
It creates the faction and adds the name in etc
But then when I add in a rank via /frankname it resets the faction name and the type and everything else to 0 so how can i make it fetch anything that is above 0 and then if it is save with the ranks and anything else??
pastebin link to saving, creating and loading code: http://pastebin.com/2R19fkTN
thanks
pawn Код:
CMD:createfaction(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 4) {
new
iFac = getFreeFaction(), amount, weapons, string[128];
if(iFac == -1) {
return SendClientMessage(playerid, -1, "There is too many factions.");
}
if(sscanf(params, "s[64]d", arrFaction[iFac][g_szFactionName], amount, weapons)) {
return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /createfaction [name] [type(/factypes)]");
}
format(string, sizeof(string), "You have created a faction called %s, faction ID %i & type %d has been assigned to it!", arrFaction[iFac][g_szFactionName], iFac, amount);
arrFaction[iFac][g_iFactionType] = amount;
SendClientMessageEx(playerid, COLOR_WHITE, string);
CreateDynamicFaction(iFac);
SaveDynamicFaction();
}
return 1;
}
But then when I add in a rank via /frankname it resets the faction name and the type and everything else to 0 so how can i make it fetch anything that is above 0 and then if it is save with the ranks and anything else??
pastebin link to saving, creating and loading code: http://pastebin.com/2R19fkTN
thanks