Giter VIP home page Giter VIP logo

ss-gang-system-sqlite's Introduction

SS-Gang-System-SQLITE

Dynamic gang system for SA-MP.This filterscript allows user to create custom gang,fight gang wars with other gangs and take over gang zones.The script available in both SQLITE and MySQL versions.This script undergone many tests by various server owners and scripters.If you found any bug or if you have any suggestions or improvements open an issue or make a pull request.

"pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic" "pic"

Commands

*   /gcp        - to enter gang control panel
*   /creategang - to create new gang
*   /gangtag    - to add tag to your gang
*   /gwar       - to challenge other gang members for a gang war
*   /backup     - to request backup
*   /gkick      - to kick a member from gang
*   /setleader  - to set a member to leader
*   /gmembers   - to see whole members of gang
*   /top        - to see top 10 gangs
*   /ginvite    - to invite some to your gang
*   /accept     - to accept an invitation
*   /decline    - to decline an invitation
*   /gangcolor  - to change your gang color
*   /lg         - to leave the gang
*   /capture    - to capture a gangzone
*   /createzone - to create a gang zone(Rcon only)
*   /removezone - to remove a created zone(Rcon only)
*   /zones      - to show all gang zone and their details
*   /ghelp      - to view all cmds

Latest Changes

* Gang War logic has been re written now.Limit of on gangwar per time is removed.
* Gang ownership logic has been modified.Now system checks for another leader if the one leader leaves the gang.
* Added support for streamer.(See the custom settings)
* Changed database schema.(Old db is no longer supported.Delete it before using upgraded one).
* Minor bug fixed and optmisations.
* Added removezone command

Custom Settings

#define DEBUG (true)  // for debuging 
#define USE_STREAMER  (true)    //defining true uses streamer otherwise the script uses y_areas
#define MAX_GANGS                (50)
#define MAX_GZONES               (50)
#define MAX_GANG_WARS            (10) //Maximum number of gang wars at a time
#define ZONE_COLOR               (0xF3F0E596)
#define ZONE_LOCK_TIME           (10) //NOTE:The time should be given in seconds
#define ZONE_CAPTURE_TIME        (5)  //Same as above note
#define MAX_SCORE                (0)  //Maximum score to create a gang
#define ZONE_COLOR_OPAQUE_VALUE  (100)//Opaque value
#define CHAT_SYMBOL              '#'  //The prefix used for gang chat in game

Plugins and Libraries

Building and Installing

* Compile SS_GANG_MAIN.pwn
* Copy SS_GANG_MAIN.amx to filterscripts folder
* Add SS_GANG_MAIN  to server.cfg

Special Thanks

ss-gang-system-sqlite's People

Contributors

amirsavand avatar sreyas-sreelal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ss-gang-system-sqlite's Issues

Convert to INI

Hello SS !

i need this script for merge it to San Andreas Playground Gamemode
but i don't think SQLite is good so i need it to be on INI or Mysql

but i don't have time (School DAMN !!) and i'm not good on Converting From SQLite to something

Please if u have a free time do u can convert it for me (in a Tree on Github ofc ) ? :)

Thanks
Yaa (Yassine)

Things to do

  • Split to Modules
  • Normalise DataBase.
  • Implement Streamer.
  • Implement a checking feature while capturing a zone so that if the person started war left the zone wont make the conquering stop.
  • Remove the limit of one gang war at a time.

Improve code base and refactor

The code base is really old and it's been 2 years since any major update has been done on this project.The code requires serious analysis and refactoring.

Editing The Script

Hello SS

i can edit this script ?

i want to edit the commands and somethings
i will give u credits of course

Yassine

Store the database credentials in a .ini file

The scripter has to recompile the script every time they change the credentials for their database. To recompile the script, they also need all the includes. While a scripter is expected to have all these, it's not guaranteed.

The first possible solution that I can think of is the use of a .ini file that stores all this data. Any better ideas?

db_next_row

how to replace this db_next_row and mysql_retrieve_row to MySQL (R39) ???

there mysql_next_row on R6 / R7 But it's very old there any way to replace it with lastest ??

Code corrigenda

This is a list of mistakes, questionable or improvable code that I came across while updating the filterscript to MySQL:

PAWN

1. Gang data and user data are put into the same enum. While not wrong and absolutely fine, it's ambiguous and may cause confusion (this was especially the case for me) (see further references to this).

  1. https://goo.gl/KDQhbF : _Zone is a non-descriptive name.

3. https://goo.gl/6JEqW2 : There's a for-loop and I can't figure out a logical reason for it. It has no body and does exactly what the do-while loop does.

4. https://goo.gl/zVHhqe (till line 305): zMinX, zMinY, zMaxX and zMaxY are defined as floats, but loaded in as integers.

  1. https://goo.gl/dnyDzG : These values can be stored in a database. It brings more flexibility to the script as well as more predefined choices (what if the server wants them to be true upon starting the filterscript?).

6. https://goo.gl/fBMw0E : You're addressing ZInfo of which the first dimension is limited to MAX_GZONES, but you're using SS_Player to iterate through it. Shouldn't that be Zones?

7. (No specific line): You are oversizing quite a few string variables.

8. (No specific line): gangleader can only assume two values: 0 or 1. It would be more convenient if you declare it as a boolean variable and a tiny integer in the database (this is debatable since PAWN is a typeless language).

9. https://goo.gl/Yao89G: You are retrieving the player's name in OnPlayerText while you have it stored in a global variable.

10. (No specific line): You are creating new string variable under each flow control statement while it would be better to move the declaration to outside the statement and reuse it throughout the function. The naming would be a bit ambiguous, but it's a good habit (and possibly even more efficient).

SQL

1. The overall database structure seems odd to me. (PAWN NĀ°1) (*)
2. The database lacks relations where they are useful.
1. An example of such is the members table. It has a column GangName, but I don't see the use for that. You can retrieve the gang's name, of which the player is a member, by running an extra SELECT query or reversing the SELECT query via a relationship (FK).

(*) A few alternatives to handle gamemode tables better:
- Create an include that handles logging in and registering (a callback OnPlayerLogin/OnPlayerRegister?)
- Assume the server doesn't have a players table and force data into it when the player spawns
- Lay restrictions to the server that it is loaded on:
- The server must restart after loading the filterscript
- The server must execute a few predefined commands to get it all working correctly

In case that you don't want to assume that the gamemode doesn't have a players table, then the best alternative would be to force the scripter to adjust a few defines in the filterscript.


I based all these points on assumptions. I assumed something while it might mean something else, so please, don't take this as absolute criticism. The conversion isn't completed yet by the time I submit this issue, so it doesn't include all the code that I thought needed a more detailed explanation. Notice that most of the points brought up can be found when scrolling through the first 200 lines.

Let us have an open discussion about what your intentions were/are at certain parts. They may not be as clear to me by just reading the code :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.