Need help assigning IDs
#4

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Use an enumerator + an array, then put all the vars about the gangs inside, such as

PHP код:

enum 1gangInfo
{
    
gangID,
    
gangLeader,
    
gangMembers,
    
gangName[],
};
new 
infoGang[MAX_GANGS][1gangInfo]; 
Then, when you create a gang with an InGame command, use a for loop to check if a gang id is free (start your gangs id from 1), and if it is, use it !

PHP код:
new g;
for(
0MAX_GANGSg++)
{
    if(
infoGang[g][gangID] == 0) break;
}
infoGang[g][gangID] = g;
// etc 
if you need more explainations, then just ask.
The first part is okay , but explain the 2nd part please, Thankyou for your very fast reply

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Take a global variable
Код:
new gangid;//insert this at the top of your gamemode
When player registers/creates a gang ,create an increment to the variable like this
Код:
gangid=gangid+1
That might be a bit hard
Reply


Messages In This Thread
[SOLVED]Need help assigning IDs - by superrobot48 - 23.05.2014, 11:48
Re : Need help assigning IDs - by S4t3K - 23.05.2014, 11:54
Re: Need help assigning IDs - by Rittik - 23.05.2014, 11:54
Re: Need help assigning IDs - by superrobot48 - 23.05.2014, 11:57
Re : Need help assigning IDs - by S4t3K - 23.05.2014, 11:59
Re: Re : Need help assigning IDs - by superrobot48 - 23.05.2014, 12:00
Re : Need help assigning IDs - by S4t3K - 23.05.2014, 12:04
Re: Need help assigning IDs - by superrobot48 - 23.05.2014, 12:10

Forum Jump:


Users browsing this thread: 1 Guest(s)