26.10.2016, 15:49
I'm making a faction system using finfo as the enum and FactionInfo as the info variables. So everything is setup but how do i make slots for factions?
enum fInfo
{
FacName[50],
FacOwner[20],
FacLevels,
FacRanks,
FacSlots[10] //im not sure about this variable
};
#define MAX_FACTIONS 10 // at defines stock GetUnusedFaction() { new hf[64]; for(new h=0; h<=MAX_FACTIONS; h++) { format(hf,sizeof(hf),"The file you saving factions",h); if(dini_Exists(hf)) continue; return h; } return -1; }
PHP код:
|
new fact[100][fInfo];
stock NewFaction(nam[],ownername[],levels,ranks)
{
new i = currentfaction+1;
format(fact[i][FacName],50,"%s"nam);
format(fact[i][FacOwner],20,"%s"ownername);
fact[i][FacLevels] = levels;
fact[i][FacRanks] = ranks;
}
CMD:createfac(playerid,params[])
{
new name[50],owner[20],level,rank;
if (sscanf(params, "ssii", name, owner,level,rank)) return SendClientMessage(playerid, 0xFF0000AA, "Error")
NewFaction(name,ownername,level,ranks);
// Use Have to enter command like this /createfac Knights John 10 5
}