Just a simple question
#1

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?
Reply
#2

What do you mean by slots, like making an amount of max factions or ?
Reply
#3

Like if we do /createfaction a slot gets used up by that faction which is created. Yeah in amount of max factions
Reply
#4

can u show Enum of factioninfo pls.
Reply
#5

PHP код:
enum fInfo
{
    
FacName[50],
    
FacOwner[20],
    
FacLevels,
    
FacRanks,
    
FacSlots[10//im not sure about this variable
}; 
Reply
#6

Код:
#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;
}
and also remove FacSlots from finfo.

The codes that are up here will get the unused faction slot and also reads if the max_factions has been reached.
Reply
#7

I didn't understand :/ i need some explanations and some simple steps pls
Reply
#8

BUMP
Reply
#9

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
enum fInfo
{
    
FacName[50],
    
FacOwner[20],
    
FacLevels,
    
FacRanks,
    
FacSlots[10//im not sure about this variable
}; 
PHP код:
new fact[100][fInfo];
stock NewFaction(nam[],ownername[],levels,ranks)
{
    new 
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"nameowner,level,rank)) return SendClientMessage(playerid0xFF0000AA"Error")
    
NewFaction(name,ownername,level,ranks);
    
// Use Have to enter command like this /createfac Knights John 10 5
    

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)