Turf system
#1

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

bumb
Reply
#3

Do you mean like CreateGangZone and ShowGangZoneForPlayer?
Reply
#4

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

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
Reply
#6

bumb
Reply
#7

BUMP please someone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)