Enum variable which isn't a playerid (+REP)
#1

PHP код:
enum FactionData
{
    
Name,
    
Materials,
    
Guns,

so how can i get the faction? my factions exist in a folder and they're named by their name, for example: Ballas.ini etc, and I can't do this: new FDB[MAX_FACTIONS][FactionData] since MAX_FACTIONS isn't exist.
sry for my fucking shitty english i wrote it in a minute.
Reply
#2

You could count the files in the folder (I didn't figure out how but I think it's possible) and set MAX_FUNCTION to it, or make a variable and increase it everytime you load a file, which I usually do, or you could do the easiest way if they don't change and add a random number that no one can exceed it, for example 100, but it'll take unnecessary memory.
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
You could count the files in the folder (I didn't figure out how but I think it's possible) and set MAX_FUNCTION to it, or make a variable and increase it everytime you load a file, which I usually do, or you could do the easiest way if they don't change and add a random number that no one can exceed it, for example 100, but it'll take unnecessary memory.
I didnt really get it can u show me an example pls?
Reply
#4

I will, show me the "create faction" function or command
Reply
#5

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
I will, show me the "create faction" function or command
There's no create faction cmd, I make it manually.
Reply
#6

How ?,

And if you make in manually just increase the MAX_FUNCTIONS manually too, like this
pawn Код:
#define MAX_FUNCTIONS 5
and every time you add one increase it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)