SA-MP Forums

Go Back   SA-MP Forums > SA-MP > General

Reply
 
Thread Tools Display Modes
Old 25/07/2013, 07:52 AM   #1
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,179
Reputation: 311
Default Organisational include

Hello guys.
The sheer amount of threads asking for member group, faction, administrator, VIPs, cops and robbers teams, battle teams, etc, filterscripts is huge. The difference between them is the way they are handled, but basically they are just organisations and levels. I was thinking about making a final include for this that would make it all end, may be like:
pawn Code:
enum player
{
      pORGANISATION_level
      bool:pleader
}
new playerINFO[MAX_PLAYERS][player];

stock SetPlayerLevel( playerid, level )
{
      return playerInfo[playerid][pORGANISATION_level] = level;
}

stock Player_HasEnoughLevel(playerid, level)
{
      switch playerINFO...
       
          return true;
         return false;
}
I think you get the idea. But then the whole include just gets over in a few stocks (Setting and Getting) which isn't quite that helpful nor that attractive. Can anyone suggest me what I can add so any organisation can be made with this, and you don't need to answer threads over this all day?
Thanks, cheers
RajatPawar is offline   Reply With Quote
Old 25/07/2013, 08:05 AM   #2
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,809
Reputation: 701
Default Re: Organisational include

All we need is basic functionality. We can tell people "use this" and give them an example of how to make group-only commands and functions. It doesn't need to be pretty, it just needs to get the job done.
Scenario is offline   Reply With Quote
Old 25/07/2013, 08:14 AM   #3
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,179
Reputation: 311
Default Re: Organisational include

That is true. I however, have this idea - define different organisations and then make different stocks for them. I am unsure on how to go about on that though. Suppose -
pawn Code:
#define ORG_VIP 14124
#define ORG_MEMGROUP 1511
#define ORG_ADMIN 21995
#define ORG_FACTION 981

#define USE_INCLUDE_FOR ORG_ADMIN // Use my include for making what organisation?

#if USE_INCLUDE_FOR == ORG_ADMIN

stock GetAdminLevel(..)
#else if USE_INCLUDE_FOR ORG_VIP

..
#end if
Something like that could work? Would it?
RajatPawar is offline   Reply With Quote
Old 25/07/2013, 12:34 PM   #4
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,179
Reputation: 311
Default Re: Organisational include

Sorry for double posting, but if anyone was wondering (I doubt), I already made it (Link is in my signature). And instead of using directives, I used a multi dimensional array POV.
Organisation definition ---> stocks
instead of
Stocks ---> Organisation definition.
RajatPawar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[PEDIDO] Include #include <lethaldudb2> ? Hancoc Português/Portuguese 1 26/02/2012 09:05 PM
[FS+ Include]YossI's Health include GiP_YossI Filterscripts 10 17/04/2011 06:15 PM
Making an OnFilterScriptInit in an include without adding anything in the .pwn exepct the #include r3k1lLz_ Help Archive 6 06/01/2011 07:49 AM
[HELP] About #include boynumber5 Help Archive 1 28/03/2010 04:04 PM


All times are GMT. The time now is 05:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.