[FilterScript] Gang System DK
#1

Features
  • Gang zone creator in-game
  • Create gang in-game
  • Invite players
  • Kick members
  • Private gang vehicles
  • Conquer gang zones
  • Gang tag
  • Revenue money from conquired zones
  • Plate on gang vehicles
  • [new]Added Gang PayDay system
Commands
  • All players
    • /Gang - See all commands
    • /Gang Info - See help for Gang System
    • /Gang Create - Create a gang's
    • /Gang Invite - Invite a player to join in your gang's
    • /Gang Join - Accept the last gang's invite
    • /Gang Leave - Abbandona la gang's attuale
    • /Gang Stats - See your gang's stats
    • /Gang List - See the gang's list
    • /Gang PaymentList - See all member's Payment percentage
    • /Gang Top - See the SCORE (Tot Conquired Zones + (Tot Gang Kills / 10)), TOT GANG KILLS and TOT CONQUIRED ZONES
  • Gang Owner
    • /Gang Kick - Kicks a player from your gang
    • /Gang Tag - Sets the gang's tag
    • /Gang Vehicle - Sets your gang's vehicle model, color1 and color2
    • /Gang Color - Changes you gang's color
    • /Gang PaymentSet - Sets the percentage of a member's payday
  • Admin
    • /Gang Zone - Create a gang zone
    • /Gang Resetcash - Reset the zone's cash
    • /Gang Pickup - Set the cash's pickup position
    • /Gang Vehzone - Set the gang's vehicles position
Sreenshots and Videos
https://www.youtube.com/watch?v=KQkEk058lfg


Scriptfiles & Defines
pawn Код:
#define MAX_ZONES 64            //Max zones
#define MAX_GANGS 20            //Max gangs
#define MAX_MEMBERS 15          //Max Gang's members
#define MAX_GVEHICLES 3         //Max Vehicle for a zone
#define GANG_CASH_ICON_ID 0

#define AllowDecreaseTotKills true //If it is true, when a player in a gang death, the player's gang TotKills will decrease

#define MembersForConq 3        //Members needed to conquer a gangzone
#define TimeForConq 60000       //Time in milliseconds to conquire a gangzone
#define MoneyAfterConq 2500     //Will give this value at all members who conquired a zone
#define TimerAddCash 60000      //Every this time, the gangzone will receve the value AddCash
#define AddCash 25              //influeced by TimerAddCash: Every that time, the cash of gang zones will increased with this value
#define mapiconid 0
#define GangPayDay 12           //Expressed in hour (Will give gang money on this hour of the day at the members, default: 12:00)

#define GangCFGFile     "M3_Server/GangFS/Gang.cfg"         //Create a little Info about Gang and Zones created
#define GangIDFile      "M3_Server/GangFS/Gangs/%d.cfg"     //Storage the gang file
#define GangZoneFile    "M3_Server/GangFS/Zones/%d.cfg"     //Storage the zone file
#define GangUserFile    "M3_Server/GangFS/Users/%s.ini"     //Storage User file (Of gang system)
#define UserBankFile    "M3_Server/GangFS/Users/%s.ini"     //Storage the cash of the payday's Player (Important to change it if you have an another folder for your Bank System)
Includes
pawn Код:
#include <a_samp>
#include <streamer>
#include <Dini>
#include <sscanf2>
Plugins
"Streamer" by Incognito: https://sampforum.blast.hk/showthread.php?tid=102865

Downloads
Quote:
GangDK3.0
GangDK96_3.0.pwn
GangDK96_3.0.amx
GangDK96_3.0.rar
  • Added Gang PayDay
BUGS:
  • The percentage of a member can be up of 100/100
Quote:
GangDK3.1
GangDK96_3.1.pwn
GangDK96_3.1.amx
GangDK96_3.1.rar
  • Bug fixed (setting member percentage problem)
  • Added message of percentage changed with "/gang paymentset" command
BUGS:
NOTHING

Quote:
GangDK3.1.2
GangDK96_3.1.2.pwn
GangDK96_3.1.2.amx
GangDK96_3.1.2.rar
  • Added shorter command (now you can use "/g" and "/gang")
  • Added gang score (too see the gang score use /gang top)
BUGS:
NOTHING, FOR NOW

Credits:
DarK_FeneR996 (me) (ALL THE SCRIPT)
shourya12 Suggestion of Top Gang and Shorter Gang command
Tommyx3 Suggestion Shorter Gang command and little code helping for Shorter Gang Command
Reply
#2

Nice one , good work ! may you contact me plz i need u urgent !
Reply
#3

You're not allowed to use adf.ly links.
Reply
#4

Quote:
Originally Posted by Infinity
Посмотреть сообщение
You're not allowed to use adf.ly links.
Why not? Anyway I'll remove link

Okay I read again forum rules, sorry to all
Reply
#5

Gud
Reply
#6

Gang System updated to v2.5
-Solved gang vehicle function bugs
Reply
#7

Updated to version 3.0
new feature: Gang PayDay
Reply
#8

Well , Good job ? but is there are /GANG WAR system ?? Gzones...
Reply
#9

Yes, if three members of one gang are > 3 the zone will be yours
Reply
#10

Sounds cool
mmm , WHAT ABOUT TO ADD /gprm to promte the gang members , from rank to rank ,
Reply
#11

This looks like it was created in 2007 I have a hard time believing this this not ripped off and modified from somewhere. Too much D&D (dini & dcmd) the design makes this a 1-star script you could do everything better.
Reply
#12

Sorry for double post
Reply
#13

It looks like you are thinking. I remade the script because it was bugged, very bugged. The founder left samp and so he didn't fixed bugs. And because it was very poor, I added more functions. This is better than the 2007. I prefer mine

PS: There are just one command DCMD. After this I checked with strcmp other commands

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(gang, 4, cmdtext);
    return 0;
}

//gang inizio
dcmd_gang(playerid, params[])
{
    new gcmd[16];
    if(sscanf(params, "s[16]", gcmd))
    {
        SendClientMessage(playerid, COLOR_ARANCIONE, "Use: /gang <Type>");
        SendClientMessage(playerid, COLOR_GIALLO, "_________________Gang System Commands_________________");
        SendClientMessage(playerid, COLOR_VERDE, "/gang info - Help the gang system");
        SendClientMessage(playerid, COLOR_VERDE, "/gang stats - Look at the details of the gang");
        SendClientMessage(playerid, COLOR_VERDE, "/gang list - Generate a list of gang created along with the gang info");
        SendClientMessage(playerid, COLOR_VERDE, "/gang create - Create a new gang");
        if(PlayerInfo[playerid][GangOwner] == true)
        {
            SendClientMessage(playerid, COLOR_VERDE, "/gang tag - Set tag for the gang");
            SendClientMessage(playerid, COLOR_VERDE, "/gang color - Select the color of the gang");
            SendClientMessage(playerid, COLOR_VERDE, "/gang kick - Kick a member of the gang");
            SendClientMessage(playerid, COLOR_VERDE, "/gang PaymentSet - Set the payday's percentage of a Member");
        }
        SendClientMessage(playerid, COLOR_VERDE, "/gang invite - Invites a player to enter the gang");
        SendClientMessage(playerid, COLOR_VERDE, "/gang join - Get into the gang to which you have been invited");
        SendClientMessage(playerid, COLOR_VERDE, "/gang leave - Leave the gang");
        SendClientMessage(playerid, COLOR_VERDE, "/gang PaymentList - See percentage of all member's payday");
        SendClientMessage(playerid, COLOR_GIALLO, "______________________________________________________");
        return 1;
    }
    if(strcmp("info", gcmd, true, sizeof(gcmd)) == 0)
    {
        SendClientMessage(playerid, COLOR_GIALLO, "_________________Tutorial Gang System_________________");
        SendClientMessage(playerid, COLOR_VERDE, "Conquest: In order to win GangZone must be at least 2");
        SendClientMessage(playerid, COLOR_VERDE, "Conquest: If the GangZone is not nobody takes 30 seconds if you are already conquered two minutes");
        SendClientMessage(playerid, COLOR_VERDE, "Earnings: Every conquest of GangZone receive Money");
        SendClientMessage(playerid, COLOR_VERDE, "Earnings: The founder may collect the revenues of the zones (money) and can spartirli, HE WANTS");
        SendClientMessage(playerid, COLOR_VERDE, "Earnings: Most areas have and the more money you'll get");
        SendClientMessage(playerid, COLOR_VERDE, "Withdrawal revenues: The founder may withdraw the revenues going into a Pickup ($ symbol)");
        SendClientMessage(playerid, COLOR_VERDE, "Withdrawal revenues: The Pickup can be found in all gangzone (PS: you can find inside interior sometimes");
        SendClientMessage(playerid, COLOR_VERDE, "Gang Chat: Each gang has its own chat, to use it just type '!' + Text (eg '! Let's win?')");
        SendClientMessage(playerid, COLOR_GIALLO, "______________________________________________________");
        return 1;
    }
    if(strcmp(gcmd, "create", true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangID] != -1) return SendClientMessage(playerid, COLOR_VERDE, "You're already in a gang, use /gang leave to leave the gang");
        ShowPlayerDialog(playerid, DIALOG_GANGCREATE, DIALOG_STYLE_INPUT, "Gang Create", "Input the nome of your new gang", "Ok", "Cancel");
        return 1;
    }
    if(strcmp("tag", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        if(PlayerInfo[playerid][GangOwner] == false) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be founder of the gang!");
        ShowPlayerDialog(playerid, DIALOG_GANGTAG, DIALOG_STYLE_INPUT, "Gang Tag", "Input the tag for your gang", "Ok", "Cancel");
        return 1;
    }
    if(strcmp("color", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        if(PlayerInfo[playerid][GangOwner] == false) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be founder of the gang!");
        ShowPlayerDialog(playerid, DIALOG_GANGCOLOUR, DIALOG_STYLE_LIST, "Change Gang Color", "{FF0000}Red\n{9900FF}Fuchsia\n{0000FF}Blue\n{0066FF}Light Blue\n{00FF00}Green\n{00FF99}Water Green\n{FFFF00}Yellow\n{FF9900}Orange\n{663300}Brown\n{FF6666}Pink\n{9900FF}Salmon", "Ok", "Cancel");
        return 1;
    }
    if(strcmp("zone", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_VERDE, "You need to be admin RCon to use this command!");
        if(CreatingZone == false)
        {
            GetPlayerPos(playerid, ZonePos[0][0], ZonePos[0][1], ZonePos[0][2]);
            CreatingZone = true;
            SendClientMessage(playerid, COLOR_GIALLO, "Redo the command in the other side to terminate the creation");
        }
        else
        {
            CreatingZone = false;
            GetPlayerPos(playerid, ZonePos[1][0], ZonePos[1][1], ZonePos[1][2]);
            for(new zoneid = 1; zoneid <= MAX_ZONES; zoneid++) //inizio controllo degli ID liberi
            {
                new ZoneFile[255];
                format(ZoneFile,sizeof(ZoneFile),GangZoneFile, zoneid);
                if(!dini_Exists(ZoneFile))
                {
                    //salvataggio CFG
                    new cfgFile[255];
                    TotZone ++;
                    format(cfgFile,sizeof(cfgFile),GangCFGFile);
                    dini_Create(cfgFile);
                    dini_IntSet(cfgFile,"TotZone", TotZone);

                    //creazione zona
                    format(ZoneFile,sizeof(ZoneFile),GangZoneFile, zoneid);
                    dini_Create(ZoneFile);
                    dini_IntSet(ZoneFile,"ZoneID", zoneid);
                    dini_IntSet(ZoneFile,"OfGangID", -1);
                    if(ZonePos[0][0] < ZonePos[1][0])
                    {
                        dini_FloatSet(ZoneFile,"X1", ZonePos[0][0]);
                        dini_FloatSet(ZoneFile,"X2", ZonePos[1][0]);
                    }
                    else
                    {
                        dini_FloatSet(ZoneFile,"X1", ZonePos[1][0]);
                        dini_FloatSet(ZoneFile,"X2", ZonePos[0][0]);
                    }
                    if(ZonePos[0][1] < ZonePos[1][1])
                    {
                        dini_FloatSet(ZoneFile,"Y1", ZonePos[0][1]);
                        dini_FloatSet(ZoneFile,"Y2", ZonePos[1][1]);
                    }
                    else
                    {
                        dini_FloatSet(ZoneFile,"Y1", ZonePos[1][1]);
                        dini_FloatSet(ZoneFile,"Y2", ZonePos[0][1]);
                    }
                    ZoneInfo[zoneid][ID] = dini_Int(ZoneFile,"ZoneID");
                    ZoneInfo[zoneid][OfGangID] = dini_Int(ZoneFile,"OfGangID");
                    ZoneInfo[zoneid][PosX1] = dini_Float(ZoneFile,"X1");
                    ZoneInfo[zoneid][PosY1] = dini_Float(ZoneFile,"Y1");
                    ZoneInfo[zoneid][PosX2] = dini_Float(ZoneFile,"X2");
                    ZoneInfo[zoneid][PosY2] = dini_Float(ZoneFile,"Y2");

                    ZoneInfo[zoneid][GZID] = GangZoneCreate(ZoneInfo[zoneid][PosX1], ZoneInfo[zoneid][PosY1], ZoneInfo[zoneid][PosX2], ZoneInfo[zoneid][PosY2]);
                    if(ZoneInfo[zoneid][OfGangID] == -1)
                    {
                        GangZoneShowForAll(ZoneInfo[zoneid][GZID], GCOLOR_GRIGIO);
                    }
                    else
                    {
                        GangZoneShowForAll(ZoneInfo[zoneid][GZID], GangInfo[ZoneInfo[zoneid][OfGangID]][Color]);
                    }
                    ZoneInfo[zoneid][CKID] = CreateDynamicRectangle(ZoneInfo[zoneid][PosX1], ZoneInfo[zoneid][PosY1], ZoneInfo[zoneid][PosX2], ZoneInfo[zoneid][PosY2]);

                    //ferma il ciclo dopo la creazione gang
                    zoneid = MAX_ZONES;
                }
            }
        }
        return 1;
    }
    if(strcmp("pickup", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_VERDE, "You need to be admin RCon to use this command!");
        ShowPlayerDialog(playerid, DIALOG_GANGPICKUP, DIALOG_STYLE_INPUT, "PickUp Zone Create", "Input the ID of the zone to assign the Pickup", "Ok", "Cancel");
        return 1;
    }
    if(strcmp("stats", gcmd, true, sizeof(gcmd)) == 0)
    {
        new gangid = PlayerInfo[playerid][GangID];
        if(gangid == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        new GangFile[255];
        format(GangFile, sizeof(GangFile), GangIDFile, gangid);
        if(!dini_Exists(GangFile)) return SendClientMessage(playerid, COLOR_ROSSO, "Gang doesn't exist! Il founder will abandoned the gang...");
        new MembriOn = 0;
        for(new l = 0; l < MAX_PLAYERS; l++)
        {
            if(IsPlayerConnected(l) && PlayerInfo[l][GangID] == gangid) MembriOn ++;
        }

        new ZoneDellaGang = 0;
        new ZoneFile[255];
        for(new z = 0; z < MAX_ZONES; z++)
        {
            format(ZoneFile, sizeof(ZoneFile), GangZoneFile, z);
            if(dini_Exists(ZoneFile)) if(ZoneInfo[z][OfGangID] == gangid) ZoneDellaGang ++;
        }
        new strENG[255];
        format(strENG, sizeof(strENG), "ID: %d | Name: %s | Founder: %s | Conquired zones: %d | Online Members: %d", GangInfo[gangid][GangID], GangInfo[gangid][GangName], GangInfo[gangid][Owner], ZoneDellaGang, MembriOn);
        SendClientMessage(playerid, GangInfo[gangid][Color], strENG);
        return 1;
    }
    if(strcmp("invite", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");

        new gangid = PlayerInfo[playerid][GangID];
        if(GangInfo[gangid][Members] >= MAX_MEMBERS) return SendClientMessage(playerid, COLOR_ROSSO, "Gang reached maximum members");
        ShowPlayerDialog(playerid, DIALOG_GANGINVITE, DIALOG_STYLE_INPUT, "Gang Invite", "Insert the ID of the Player to invite", "Ok", "Cancel");
        return 1;
    }
    if(strcmp("join", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangID] != -1) return SendClientMessage(playerid, COLOR_ROSSO, "Are you already part of a gang! Use / gang leave to leave the gang present");
        if(PlayerInfo[playerid][InvitedByGang] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You have no invitation gang");

        new gangid = PlayerInfo[playerid][InvitedByGang];
        if(GangInfo[gangid][Members] >= MAX_MEMBERS) return SendClientMessage(playerid, COLOR_ROSSO, "Gang reached maximum members");
        new GangFile[255], pName[MAX_PLAYER_NAME], strENG[255], SlotFile[255], slotid = CheckFreeGangSeat(gangid);
        GetPlayerName(playerid, pName, sizeof(pName));
       
        format(GangFile, sizeof(GangFile), GangIDFile, gangid);
        format(SlotFile, sizeof(SlotFile), "Member_%d", slotid);
       
        dini_Set(GangFile, SlotFile, pName);
        MemberInfo[gangid][slotid][Name] = dini_Get(GangFile, SlotFile);
       
        if(IsPlayerInAnyDynamicArea(playerid))
        {
            new zoneid = GetPlayerNumberDynamicAreas(playerid);
            Invaders[gangid][zoneid] ++;
            if(Invaders[gangid][zoneid] == MembersForConq)
            {
                for(new l = 0; l < MAX_PLAYERS; l++)
                {
                    if(IsPlayerConnected(l) && PlayerInfo[l][GangID] == gangid)
                    {
                        SendClientMessage(l, GangInfo[gangid][Color], "You are conquiring the zone");
                    }
                }
                GangZoneFlashForAll(ZoneInfo[zoneid][GZID], GangInfo[gangid][Color]);

                if(ZoneInfo[zoneid][OfGangID] != -1)
                {
                    GangTimer[gangid][zoneid] = SetTimerEx("ConquistaGZ", TimeForConq, false, "ii", zoneid, gangid);
                }
                else
                {
                    GangTimer[gangid][zoneid] = SetTimerEx("ConquistaGZ", TimeForConq/2, false, "ii", zoneid, gangid);
                }
                for(new l; l < MAX_PLAYERS; l++)
                {
                    if(IsPlayerConnected(l) && PlayerInfo[l][GangID] == ZoneInfo[zoneid][OfGangID] && PlayerInfo[playerid][GangID] != ZoneInfo[zoneid][OfGangID] && PlayerInfo[l][GangID] != -1)
                    {
                        SendClientMessage(l, GangInfo[ZoneInfo[zoneid][OfGangID]][Color], "Your zone is under attack!");
                    }
                }
            }
        }
       
        GangInfo[gangid][Members] ++;
        dini_IntSet(GangFile,"Members", GangInfo[gangid][Members]);

        format(strENG, sizeof(strENG), "%s (ID:%d) has joined the gang %s", pName, playerid, GangInfo[PlayerInfo[playerid][InvitedByGang]][GangName]);
        SendClientMessageToAll(GangInfo[gangid][Color], strENG);

        format(strENG, sizeof(strENG), "%s (ID:%d) has joined your gang", pName, playerid);
        for(new p = 0; p < MAX_PLAYERS; p++)
        {
            if(IsPlayerConnected(p) && PlayerInfo[p][GangID] == gangid) SendClientMessage(p, GangInfo[gangid][Color], strENG);
        }

        SetPlayerColor(playerid, GangInfo[gangid][Color]);

        PlayerInfo[playerid][GangID] = PlayerInfo[playerid][InvitedByGang];

        PlayerInfo[playerid][InvitedByGang] = -1;
        return 1;
    }
    if(strcmp("leave", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        new GangFile[255], SlotFile[255], NomeGang[255];
        new gangid = PlayerInfo[playerid][GangID];
        new strENG[255];

        if(IsPlayerInAnyDynamicArea(playerid))
        {
            new zoneid = GetPlayerNumberDynamicAreas(playerid);
            Invaders[gangid][zoneid] --;
            if(Invaders[gangid][zoneid] < MembersForConq)
            {
                KillTimer(GangTimer[gangid][zoneid]);
                GangZoneStopFlashForAll(ZoneInfo[zoneid][GZID]);
            }
        }

        if(PlayerInfo[playerid][GangOwner] == true)
        {
            format(strENG, sizeof(strENG), "The founder of the gang {FFFF00}'%s' {00FF00}has abandoned the gang. The gang has dissolved", GangInfo[gangid][GangName]);
            for(new p = 0; p < MAX_PLAYERS; p++)
            {
                if(IsPlayerConnected(p) && PlayerInfo[p][GangID] == gangid)
                {
                    SendClientMessage(p, COLOR_VERDE, strENG);
                }
            }

            for(new z = 1; z < MAX_ZONES; z++)
            {
                new ZoneFile[255];
                format(ZoneFile, sizeof(ZoneFile), GangZoneFile, z);
                if(dini_Exists(ZoneFile))
                {
                    if(ZoneInfo[z][OfGangID] == gangid)
                    {
                        for(new gvehicleid; gvehicleid < MAX_GVEHICLES; gvehicleid++) DestroyVehicle(GangVehicle[z][gvehicleid][VehID]);

                        dini_IntSet(ZoneFile,"OfGangID",-1);

                        ZoneInfo[z][OfGangID] = dini_Int(ZoneFile,"OfGangID");

                        GangZoneShowForAll(ZoneInfo[z][GZID], GCOLOR_GRIGIO);
                    }
                }
            }

            format(GangFile, sizeof(GangFile), GangIDFile, PlayerInfo[playerid][GangID]);
            if(dini_Exists(GangFile))
            {
                dini_Remove(GangFile);
            }
            PlayerInfo[playerid][GangOwner] = false;
        }
        else
        {
            new slotid = CheckGangPlayerSlot(gangid, playerid);
            format(GangFile, sizeof(GangFile), GangIDFile, gangid);
            format(SlotFile, sizeof(GangFile), "Member_%d", slotid);
            GangInfo[gangid][Members] --;
           
            dini_IntSet(GangFile,"Members", GangInfo[gangid][Members]);
            dini_Set(GangFile, SlotFile, "");
           
            MemberInfo[gangid][slotid][Name] = dini_Get(GangFile, SlotFile);

            format(GangFile, sizeof(GangFile), GangIDFile, PlayerInfo[playerid][GangID]);
            if(dini_Exists(GangFile))
            {
                NomeGang = dini_Get(GangFile,"Name");
            }
            format(strENG, sizeof(strENG), "You left the gang %s (ID:%d)", GangInfo[gangid][GangName], gangid);
            SendClientMessage(playerid, COLOR_VERDE, strENG);
        }
       
        PlayerInfo[playerid][GangID] = -1;
        PlayerInfo[playerid][GangOwner] = false;
        return 1;
    }
    if(strcmp("kick", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(PlayerInfo[playerid][GangOwner] == false) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be founder of the gang!");
        ShowPlayerDialog(playerid, DIALOG_GANGKICK, DIALOG_STYLE_INPUT, "Kick Player from Gang", "Input the ID of the player to kick by the Gang", "Ok", "Cancel");
        return 1;
    }
    if(strcmp("list", gcmd, true, sizeof(gcmd)) == 0)
    {
        SendClientMessage(playerid, COLOR_VERDE, "________________Gang List________________");
        for(new g = 0; g < MAX_GANGS; g++)
        {
            new GangFile[255], strENG[255];
            format(GangFile, sizeof(GangFile), GangIDFile, g);
            if(dini_Exists(GangFile))
            {
                new MembriOn = 0;
                for(new l = 0; l < MAX_PLAYERS; l++)
                {
                    if(IsPlayerConnected(l) && PlayerInfo[l][GangID] == g) MembriOn ++;
                }
                new ZoneDellaGang = 0;
                new ZoneFile[255];
                for(new z = 0; z < MAX_ZONES; z++)
                {
                    format(ZoneFile, sizeof(ZoneFile), GangZoneFile, z);
                    if(dini_Exists(ZoneFile)) if(ZoneInfo[z][OfGangID] == g) ZoneDellaGang ++;
                }

                format(strENG, sizeof(strENG), "ID: %d | Name: %s | Founder: %s | Conquired zones: %d | Members: %d | Online Members: %d", GangInfo[g][GangID], GangInfo[g][GangName], GangInfo[g][Owner], ZoneDellaGang, GangInfo[g][Members], MembriOn);
                SendClientMessage(playerid, GangInfo[g][Color], strENG);
            }
        }
        return 1;
    }

    if(strcmp("resetcash", gcmd, true, sizeof(gcmd)) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_VERDE, "You must be RCon Admin to use this command!");
        new ZoneFile[255];
        for(new zoneid = 1; zoneid <= MAX_ZONES; zoneid++)
        {
            format(ZoneFile, sizeof(ZoneFile), GangZoneFile, zoneid);
            if(dini_Exists(ZoneFile))
            {
                dini_IntSet(ZoneFile,"Cash", 0);

                ZoneInfo[zoneid][PickUpCash] = 0;

                new txt[50];
                format(txt, sizeof(txt), "Money\n%d$", ZoneInfo[zoneid][PickUpCash]);
                Update3DTextLabelText(ZoneInfo[zoneid][Label], COLOR_VERDE, txt);
            }
        }
        SendClientMessage(playerid, COLOR_VERDE, "Zones' zone resetted!");
        return 1;
    }
    if(strcmp("vehzone", gcmd, true, 7) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be admin RCon to use this command!");
        new zoneid, gvehicleid;
        if(sscanf(params, "s[16]dd", gcmd, zoneid, gvehicleid)) return SendClientMessage(playerid, COLOR_ARANCIONE, "Use: /Gang Vehicle <zoneid> <slotvehicleid>");
        if(zoneid > MAX_ZONES || zoneid < 1) return SendClientMessage(playerid, COLOR_ROSSO, "Zone ID too large or small");
        if(gvehicleid >= MAX_GVEHICLES || gvehicleid < 0) return SendClientMessage(playerid, COLOR_ROSSO, "Vehicle slot too large or small");
        new Float: gvPos[3], Float: gvAngle;
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            GetVehiclePos(vehicleid, gvPos[0], gvPos[1], gvPos[2]);
            GetVehicleZAngle(vehicleid, gvAngle);
        }
        else
        {
            GetPlayerPos(playerid, gvPos[0], gvPos[1], gvPos[2]);
            GetPlayerFacingAngle(playerid, gvAngle);
        }
        new ZoneFile[255], strX[16], strY[16], strZ[16], strAngle[16];
        format(ZoneFile, sizeof(ZoneFile), GangZoneFile, zoneid);
        format(strX, sizeof(strX), "Veh%d_X", gvehicleid);
        format(strY, sizeof(strY), "Veh%d_Y", gvehicleid);
        format(strZ, sizeof(strZ), "Veh%d_Z", gvehicleid);
        format(strAngle, sizeof(strAngle), "Veh%d_Ang", gvehicleid);
        dini_FloatSet(ZoneFile, strX, gvPos[0]);
        dini_FloatSet(ZoneFile, strY, gvPos[1]);
        dini_FloatSet(ZoneFile, strZ, gvPos[2]);
        dini_FloatSet(ZoneFile, strAngle, gvAngle);

        GangVehicle[zoneid][gvehicleid][PosX] = dini_Float(ZoneFile, strX);
        GangVehicle[zoneid][gvehicleid][PosY] = dini_Float(ZoneFile, strY);
        GangVehicle[zoneid][gvehicleid][PosZ] = dini_Float(ZoneFile, strZ);
        GangVehicle[zoneid][gvehicleid][Angle] = dini_Float(ZoneFile, strAngle);
       
        new strENG[128];
        format(strENG, sizeof(strENG), "vPosX: %0.02f | vPosY: %0.02f | vPosZ: %0.02f | vAng: %0.02f", GangVehicle[zoneid][gvehicleid][PosX], GangVehicle[zoneid][gvehicleid][PosY], GangVehicle[zoneid][gvehicleid][PosZ], GangVehicle[zoneid][gvehicleid][Angle]);
        SendClientMessage(playerid, COLOR_VERDE, strENG);

        DestroyVehicle(GangVehicle[zoneid][gvehicleid][VehID]);

        if(ZoneInfo[zoneid][OfGangID] != -1)
        {
            new gangid = ZoneInfo[zoneid][OfGangID], gPlate[8];
            if(GangInfo[gangid][VehModel] >= 400 && GangInfo[gangid][VehModel] <= 611)
            {
                new vehiclemodel = GangInfo[gangid][VehModel], col1 = GangInfo[gangid][VehCol1], col2 = GangInfo[gangid][VehCol2];
                GangVehicle[zoneid][gvehicleid][VehID] = CreateVehicle(vehiclemodel, GangVehicle[zoneid][gvehicleid][PosX], GangVehicle[zoneid][gvehicleid][PosY], GangVehicle[zoneid][gvehicleid][PosZ], GangVehicle[zoneid][gvehicleid][Angle], col1, col2, 1800000);
                format(gPlate, sizeof(gPlate), "[%s]-%d", GangInfo[gangid][Tag], gvehicleid);
                SetVehicleNumberPlate(GangVehicle[zoneid][gvehicleid][VehID], gPlate);
            }
        }

        format(strENG, sizeof(strENG), "Zone ID: %d | Vehicle Slot: %d", zoneid, gvehicleid);
        SendClientMessage(playerid, COLOR_VERDE, strENG);
        return 1;
    }
   
    if(strcmp("paymentlist", gcmd, true, 11) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        if(PlayerInfo[playerid][GangOwner] == false) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be founder of the gang!");
        new strENG[512], gangid = PlayerInfo[playerid][GangID], PerCentRemain, strTitle[128];
        format(strENG, sizeof(strENG), "Member Name\tPercentage\n");
        for(new slotid; slotid < MAX_MEMBERS; slotid++)
        {
            if(strlen(MemberInfo[gangid][slotid][Name]) > 1) format(strENG, sizeof(strENG), "%s{00FF00}%s\t%d/100\n", strENG, MemberInfo[gangid][slotid][Name], MemberInfo[gangid][slotid][Percentage]);
            else format(strENG, sizeof(strENG), "%s{FF0000}<Empty>\t%d/100\n", strENG, MemberInfo[gangid][slotid][Name], MemberInfo[gangid][slotid][Percentage]);
            PerCentRemain += MemberInfo[gangid][slotid][Percentage];
        }
       
        PerCentRemain = 100 - PerCentRemain;
        format(strTitle, sizeof(strTitle), "Payment (%d/100 percentage Remains) Gang's Bank: $%d", PerCentRemain, GangInfo[gangid][Bank]);
        ShowPlayerDialog(playerid, DIALOG_PAYMENT, DIALOG_STYLE_TABLIST_HEADERS, strTitle, strENG, "Select", "Exit");
        return 1;
    }
   
    if(strcmp("paymentset", gcmd, true, 10) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        if(PlayerInfo[playerid][GangOwner] == false) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be founder of the gang!");
        new pName[MAX_PLAYER_NAME], UserPay;
        if(sscanf(params, "s[16]s[MAX_PLAYER_NAME]d", gcmd, pName, UserPay)) return SendClientMessage(playerid, COLOR_ARANCIONE, "Use: /Gang PaymentSet <NickName> <Percentage>");
        new GangFile[255], gangid = PlayerInfo[playerid][GangID], SlotFile[255], slotid;
        format(GangFile, sizeof(GangFile), GangIDFile, gangid);
        if(IsNumeric(pName))
        {
            new UserID = strval(pName);
            if(!IsPlayerConnected(UserID)) return SendClientMessage(playerid, COLOR_ROSSO, "The player is not connected");
            slotid = CheckGangPlayerSlot(gangid, UserID);
           
        }
        else slotid = CheckGangPlayerNameSlot(gangid, pName);
       
        format(SlotFile, sizeof(SlotFile), "MemberCash_%d", slotid);
        dini_IntSet(GangFile, SlotFile, UserPay);
        MemberInfo[gangid][slotid][Percentage] = dini_Int(GangFile, SlotFile);
        return 1;
    }

    if(strcmp("vehicle", gcmd, true, 7) == 0)
    {
        if(PlayerInfo[playerid][GangID] == -1) return SendClientMessage(playerid, COLOR_ROSSO, "You aren't in any gang!");
        if(PlayerInfo[playerid][GangOwner] == false) return SendClientMessage(playerid, COLOR_ROSSO, "You need to be founder of the gang!");
        new modelid, col1, col2;
        if(sscanf(params, "s[16]ddd", gcmd, modelid, col1, col2)) return SendClientMessage(playerid, COLOR_ARANCIONE, "Use: /gang vehicle <modelid> <Color1> <Color2>");
        if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_ROSSO, "Use numbers from 400 to 611");
        new GangFile[255], gangid = PlayerInfo[playerid][GangID];
        format(GangFile, sizeof(GangFile), GangIDFile, gangid);
        dini_IntSet(GangFile, "VehModel", modelid);
        dini_IntSet(GangFile, "VehCol1", col1);
        dini_IntSet(GangFile, "VehCol2", col2);

        GangInfo[gangid][VehModel] = dini_Int(GangFile, "VehModel");
        GangInfo[gangid][VehCol1] = dini_Int(GangFile, "VehCol1");
        GangInfo[gangid][VehCol2] = dini_Int(GangFile, "VehCol2");
       
        new strENG[128];
        format(strENG, sizeof(strENG), "You setted %s (Model: %d) (Color 1: %d | Color 2: %d) as gang vehicle", VehicleNames[GangInfo[gangid][VehModel]-400], GangInfo[gangid][VehModel], GangInfo[gangid][VehCol1], GangInfo[gangid][VehCol2]);
        SendClientMessage(playerid, GangInfo[gangid][Color], strENG);

        for(new zoneid = 1; zoneid < MAX_ZONES; zoneid++)
        {
            if(ZoneInfo[zoneid][PosX1] != 0 && ZoneInfo[zoneid][OfGangID] == gangid)
            {
                new gPlate[8];
                for(new gvehicleid; gvehicleid < MAX_GVEHICLES; gvehicleid++)
                {
                    DestroyVehicle(GangVehicle[zoneid][gvehicleid][VehID]);
                    if(GangVehicle[zoneid][gvehicleid][PosX] != 0)
                    {
                        GangVehicle[zoneid][gvehicleid][VehID] = CreateVehicle(GangInfo[gangid][VehModel], GangVehicle[zoneid][gvehicleid][PosX], GangVehicle[zoneid][gvehicleid][PosY], GangVehicle[zoneid][gvehicleid][PosZ], GangVehicle[zoneid][gvehicleid][Angle], GangInfo[gangid][VehCol1], GangInfo[gangid][VehCol2], 1800000);
                        format(gPlate, sizeof(gPlate), "[%s]-%d", GangInfo[gangid][Tag], gvehicleid);
                        SetVehicleNumberPlate(GangVehicle[zoneid][gvehicleid][VehID], gPlate);
                    }
                }
            }
        }
        return 1;
    }

    return SendClientMessage(playerid, COLOR_ROSSO, "[Gang]Unknown gang command: type /gang to see all gang's commands");
}
About too many dini... yes, but it is to update the Gang and Zones Stats, About user saving are just in OnPlayerConnect and Disconnect
Reply
#14

Quote:
Originally Posted by ItzzWesty
Посмотреть сообщение
Sounds cool
mmm , WHAT ABOUT TO ADD /gprm to promte the gang members , from rank to rank ,
Yes I can do it... But can you give me ideas to how use this privileges? For what functions? Chose tag and color? To invite new members? Give me ideas
Reply
#15

Well , it's just idea
but you can add GANG TAG up yo the name !
Reply
#16

Quote:
Originally Posted by ItzzWesty
Посмотреть сообщение
Well , it's just idea
but you can add GANG TAG up yo the name !
Tag will show after your name (as: DarK_FeneR996 [TAG]) when you write in main chat
Reply
#17

I do not go .
I added fs the game goes and no one command
Reply
#18

Quote:
Originally Posted by jazzyKISS
Посмотреть сообщение
I do not go .
I added fs the game goes and no one command
Okay... Can you invite me on your server to understand the problem please? I have no one, so I can't see all the problems. If you invite me, I can fix the bug

I think I found the proble. it is on the FS Name... Change the fs name in GangDK96. be sure to chenge it on server.cfg too
Reply
#19

you can make the cmds shortcut
like
/gang info = /ginfo
/gang create = /gcreate
/gang stats = /gstats ...3
Reply
#20

Quote:
Originally Posted by ItzzWesty
Посмотреть сообщение
you can make the cmds shortcut
like
/gang info = /ginfo
/gang create = /gcreate
/gang stats = /gstats ...3
Mh yea... I can add a shorcut like "/g info". But I have to find a way to do this with dcmd... I never used this way
I would like to do both commands... "/gang info" "/g info"... If you wants to change it... You can do this:

pawn Код:
Chenge this command in OnPlayerCommandText:
dcmd(gang, 4, cmdtext);
To
dcmd(g, 1, cmdtext);

Change this command:
dcmd_gang(playerid, params[])
To
dcmd_g(playerid, params[])
In this way you have to use /g and not /gang
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)