SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 04/05/2016, 10:35 PM   #1
Private200
High-roller
 
Private200's Avatar
 
Join Date: May 2012
Location: Albania
Posts: 1,182
Reputation: 173
Default Dynamic Faction System [SQL | EasyDB]

Dynamic Faction System
_________________________________________________

Introduction

• This filterscript was started about a week after I finished my vehicle system. It's not the best dynamic faction system you can't find out there, mostly due to lack of commands. However, I will make sure more commands will be added by the pass of time, as well as authorizing different people to work on the filterscript in order to add new commands.

Commands

• As every filterscript (at least, most of them) there are two type of commands, player commands and RCON commands. RCON commands mostly modify the faction settings, while player commands do not do so.

Player commands:

- /factions -> Shows a dialog with all the server factions (creation date; faction name; members/faction limit)
- /lockers -> Access faction lockers (weapon menu; clothes menu; healing)

Leader commands:

- /fkick -> Kicks someone from the faction
- /finvite -> invite someone into the faction
- /setfacranks -> modifies faction ranks
- /setrank -> sets someone rank while being in the faction

RCON commands:

- /createfaction -> creates a faction
- /setflimit -> sets the faction members limit
- /updateflockers -> updates faction locker position
- /setfaction -> sets someone's faction
- /savefactions -> saves all factions
- /reloadfacs -> reloads all factions

Functions

Code:
CreateFaction(fname[], Float:PlayerPosX, Float:PlayerPosY, Float:PlayerPosZ, ftype)
SaveFaction(facid)
LoadFactions()
UnloadFactions()
GetAvailableFactionID()
GetAvailableRankID(factionid)
ReturnLastKey()
IsValidFactionID(id)
IsPlayerInAFaction(playerid)
GetRankName(factionid, rank)
WeaponToModel(wepid)
F.A.Q

• How many faction types are there?
- Currently, there are just 3 faction types:

#define LAW 1
#define FIRE 2
#define GOV 3

• What is DEBUG_MODE?
- Debug_MODE is/was used by me to understand what's happening with the code in loops and such. If it is commented, it will work like a normal filterscript. If it is not commented, it will show almost everything that happens in the script.

• How to add new skins?
- Skins have their own enum:

Code:
enum FactionSkins {
	sid,
	skinID,
	skinName[36],
	skinGender[10]
}

new LawSkins[][FactionSkins] =
{
	{0, 284, "LSPD", "Male"},
	{1, 285, "LSPD", "Male"}
};

You will have to add a new line containing the skin internal id (required for loops), skin ID (SAMP model id), skin name (might be whatever you want) and skin gender. An example would be "{2, 286, "LSPD", "Male"}". Make sure that the first number (sid) is counting up, means, 0,1,2,3,4,5-... etc.

• How to add new weapons?
- As I explained with the skins, it's the exactly same thing.

Code:
enum FactionWeapons {
	wid,
	weaponid,
	wammo,
	wep_name[36]
}

new LawWeaps[][FactionWeapons] =
{
	{0, 3, 1, "Nightstick"},
	{1, 24, 100, "Desert Eagle"},
	{2, 25, 100, "Shotgun"},
	{3, 29, 200, "MP5"},
	{4, 31, 300, "M4"},
	{5, 34, 50, "Sniper"}
};

This is the example for LAW weapons, there are currently 6 guns. On the sniper line,we got: 5 = sniper id; 34 = weapon id; 50 = weapon ammo; "Sniper" = weapon name.

• What includes are being used?
- The script uses a_samp, streamer, zcmd, sscanf (credits go to their proper owners). The script also uses a modified version of Gammix's EasyDB and Dialogs. I'd like to thank Gammix for providing those includes as this wouldn't be possible without him.

• Anything else we need to know?
- Everything in the script is in its own category. If you're looking for commands, you shall just CTRL + F and search commands. If you're looking for the functions, just CTRL+ F and search for Functions. I've tried to keep the code as clean as possible.

Video

http://forum.sa-mp.com/showthread.php?t=606336
https://www.youtube.com/watch?v=u99Wa2pissM
[ame]http://www.youtube.com/watch?v=u99Wa2pissM[/ame]

Download

MEDIAFIRE | PASTEBIN
__________________
Taking a break from SAMP, PM me if you need any of my help.
And no, I am not going to script for your server.

Quote:
Originally Posted by X337 View Post
it's better and easier for you to just fap with your cat.

Last edited by Private200; 22/05/2017 at 02:36 PM.
Private200 is offline   Reply With Quote
Old 05/05/2016, 05:45 AM   #2
NV1D3ATD
Huge Clucker
 
NV1D3ATD's Avatar
 
Join Date: Jan 2014
Posts: 226
Reputation: 9
Default Re: Dynamic Faction System [SQL | EasyDB]

When compiling
Quote:
C:\Users\Javier\Desktop\ -\pawno\include\sscanf2.inc(25 : warning 202: number of arguments does not match definition
C:\Users\Javier\Desktop\Rol -\pawno\include\sscanf2.inc(271) : error 025: function heading differs from prototype
C:\Users\Javier\Desktop\Rol -\filterscripts\faction.pwn(615) : error 017: undefined symbol "string"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
NV1D3ATD is offline   Reply With Quote
Old 05/05/2016, 01:14 PM   #3
Private200
High-roller
 
Private200's Avatar
 
Join Date: May 2012
Location: Albania
Posts: 1,182
Reputation: 173
Default Re: Dynamic Faction System [SQL | EasyDB]

Quote:
Originally Posted by NV1D3ATD View Post
When compiling
Just fixed, pastebin has been updated, mediafire link as well. I don't think that sscanf problem is caused by the script, however it is included in the RAR file (download using mediafire). Thanks for reporting the issue!
__________________
Taking a break from SAMP, PM me if you need any of my help.
And no, I am not going to script for your server.

Quote:
Originally Posted by X337 View Post
it's better and easier for you to just fap with your cat.
Private200 is offline   Reply With Quote
Old 07/05/2016, 05:41 PM   #4
DarkLored
High-roller
 
DarkLored's Avatar
 
Join Date: Oct 2013
Location: U.S. New York
Posts: 1,094
Reputation: 61
Default Re: Dynamic Faction System [SQL | EasyDB]

Nice work!
__________________
deviantArt

Taking my time on focusing on Education and learning how to draw.

Quote:
Originally Posted by KevinExec View Post
I don't know shit, you're an expert, telling me what to do and how noobish I am, do you think I get you?

P.S.: I offer .ini scripting services.

- Quoted by not other than KevinExec, the "master" of PAWN language
Quote:
Originally Posted by iMTube™ View Post
don't act OP coz u will never be Op
Rest in Pieces iMTube™, you won't be missed coz you are Op
DarkLored is offline   Reply With Quote
Old 08/05/2016, 02:47 PM   #5
iSteve
Big Clucker
 
Join Date: Apr 2014
Posts: 68
Reputation: 9
Default Re: Dynamic Faction System [SQL | EasyDB]

Great work mate.
Really like it.
iSteve is offline   Reply With Quote
Old 08/05/2016, 02:48 PM   #6
Radio
Little Clucker
 
Join Date: May 2016
Posts: 40
Reputation: 7
Default Re: Dynamic Faction System [SQL | EasyDB]

Really helpful for RP servers, thanks for this , will be using it.
Radio is offline   Reply With Quote
Old 09/05/2016, 07:23 PM   #7
Private200
High-roller
 
Private200's Avatar
 
Join Date: May 2012
Location: Albania
Posts: 1,182
Reputation: 173
Default Re: Dynamic Faction System [SQL | EasyDB]

If you stop any bug, make sure to report it on this thread and I'll look into it.
__________________
Taking a break from SAMP, PM me if you need any of my help.
And no, I am not going to script for your server.

Quote:
Originally Posted by X337 View Post
it's better and easier for you to just fap with your cat.
Private200 is offline   Reply With Quote
Old 18/05/2016, 06:03 PM   #8
Gogorakis
Gangsta
 
Gogorakis's Avatar
 
Join Date: Jun 2013
Location: Greece
Posts: 566
Reputation: 35
Default Re: Dynamic Faction System [SQL | EasyDB]

Good job mate.
Gogorakis is offline   Reply With Quote
Old 18/05/2016, 09:15 PM   #9
Skudinhu
Big Clucker
 
Skudinhu's Avatar
 
Join Date: Dec 2010
Location: Brasília - Brazil
Posts: 88
Reputation: 5
Default Re: Dynamic Faction System [SQL | EasyDB]

Nice Work!
__________________
Skudinhu is offline   Reply With Quote
Old 19/05/2016, 03:16 PM   #10
JawsCraft
Little Clucker
 
Join Date: May 2016
Posts: 19
Reputation: 14
Default Re: Dynamic Faction System [SQL | EasyDB]

Not Bad
JawsCraft 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
Dynamic Faction System Private200 Screenshots and Videos 0 02/05/2016 09:47 PM
Dynamic Org system, not faction LiamM Help Archive 3 05/06/2011 12:26 AM
Dynamic faction system Andregood Help Archive 6 04/05/2011 07:43 PM
Dynamic Faction System Mike_Peterson Help Archive 5 24/03/2011 05:58 PM


All times are GMT. The time now is 08:43 PM.


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