SA-MP Forums Archive
Turf system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Turf system (/showthread.php?tid=428421)



Turf system - MadafakaPro - 05.04.2013

Can anyone show me how to create Dynamic turf system using dini?


Re: Turf system - MadafakaPro - 06.04.2013

bumb


Re: Turf system - MattyG - 06.04.2013

Do you mean like CreateGangZone and ShowGangZoneForPlayer?


Re: Turf system - zT KiNgKoNg - 06.04.2013

No he wants a system where his players can fight over turf and it changes color depending on the family i think.


Re: Turf system - MadafakaPro - 06.04.2013

Yes true Ultra-Gaming, well i already have saving and loading system :
pawn Code:
stock CreateTurfs()
{
    new nomefile[32];
    for(new r = 0; r<sizeof(Turfs); r++)
    {
        format(nomefile, sizeof(nomefile),"turfs/Turf%d.txt",r);
        if (!dini_Exists(nomefile))
        {
            dini_Create(nomefile);
            dini_IntSet(nomefile,"tgid", Turfs[r][tfactionid]);
            dini_FloatSet(nomefile,"minX", Turfs[r][minX]);
            dini_FloatSet(nomefile,"minY", Turfs[r][minY]);
            dini_FloatSet(nomefile,"maxX", Turfs[r][maxX]);
            dini_FloatSet(nomefile,"maxY", Turfs[r][maxY]);
        }
        else
        {
            Turfs[r][turfid] = dini_Int(nomefile,"turfid");
            Turfs[r][tfactionid] = dini_Int(nomefile,"tfactionid");
            Turfs[r][minX] = dini_Float(nomefile, "minX");
            Turfs[r][minY] = dini_Float(nomefile, "minY");
            Turfs[r][maxX] = dini_Float(nomefile, "maxX");
            Turfs[r][maxY] = dini_Float(nomefile, "maxY");

        turfzone[r]=GangZoneCreate(Turfs[r][minX],Turfs[r][minY],Turfs[r][maxX],Turfs[r][maxY]);
        }
    }
    print("Turfs created/loaded");
}
stock GangZoneCreateEx()
{
    new nomefile[32];
    for(new r=0; r<sizeof(Turfs); r++)
    {
        format(nomefile,sizeof(nomefile),"turfs/Turf%d.txt",r);
        if(dini_Exists(nomefile))
        {
            Turfs[r][tfactionid]=dini_Int(nomefile,"tfactionid");
            Turfs[r][minX] = dini_Float(nomefile, "minX");
            Turfs[r][minY] = dini_Float(nomefile, "minY");
            Turfs[r][maxX] = dini_Float(nomefile, "maxX");
            Turfs[r][maxY] = dini_Float(nomefile, "maxY");
            turfzone[r]=GangZoneCreate(Turfs[r][minX],Turfs[r][minY],Turfs[r][maxX],Turfs[r][maxY]);
        }
    }
    return 1;
}
stock LoadTurfs(playerid)
{
    for(new r = 0; r<sizeof(Turfs); r++)
    {
        if(MafiaMember(playerid))
        {
            new colorx;
            switch(Turfs[r][tfactionid])
            {
                case 1: colorx = COLOR_GANG_CORLEONE;
                case 2: colorx = COLOR_GANG_TATTAGLIA;
                case 3: colorx = COLOR_GANG_Paterno;
                case 4: colorx = COLOR_GANG_CUNEO;
                case 5: colorx = COLOR_GANG_BARZINI;
            }
            GangZoneShowForPlayer(playerid,turfzone[r], colorx);
        }
        else
        {
            GangZoneHideForPlayer(playerid,turfzone[r]);
        }
    }
    return 1;
}
but sometimes the IDS gets bugged , and i cant create the /taketurf cmd


Re: Turf system - MadafakaPro - 06.04.2013

bumb


Re: Turf system - MadafakaPro - 08.04.2013

BUMP please someone