Gangzone don't create
#1

Hello,
I'm trying to create a TDM and I'm to the gangzones.
I load them with dini.
In printf, positions appear well, but does not create gangzones ingame.

Here are my codes:
Код:
public OnGameModeInit()
{
    for( new g; g < MAX_GANGZONES; g++ )
    {
		LoadGangzone(g);
        Zones[g][ID] = GangZoneCreate(Zones[g][Xmin],Zones[g][Ymin],Zones[g][Xmax],Zones[g][Ymax]);
    	printf("[GangZone] Zone %d (%s) loaded.",Zones[g][ID], Zones[g][Nom]);
    }
}

stock LoadGangzone(gzid)
{
	new path[128];
    format(path, sizeof(path), "Gangzones/%d.ini", gzid);
    format(Zones[gzid][Nom], 256, "%s", dini_Get(path, "Nom"));
    format(Zones[gzid][Xmin], 256, "%s", dini_Get(path, "Xmin"));
    format(Zones[gzid][Ymin], 256, "%s", dini_Get(path, "Ymin"));
    format(Zones[gzid][Xmax], 256, "%s", dini_Get(path, "Xmax"));
    format(Zones[gzid][Ymax], 256, "%s", dini_Get(path, "Ymax"));
    
    format(Zones[gzid][SpawnX], 256, "%s", dini_Get(path, "SpawnX"));
    format(Zones[gzid][SpawnY], 256, "%s", dini_Get(path, "SpawnY"));
    format(Zones[gzid][SpawnZ], 256, "%s", dini_Get(path, "SpawnZ"));
    format(Zones[gzid][Team], 256, "%s", dini_Get(path, "Team"));
    Zones[gzid][ID] = GangZoneCreate(Zones[gzid][Xmin],Zones[gzid][Ymin],Zones[gzid][Xmax],Zones[gzid][Ymax]);
	GangZoneShowForAll(Zones[gzid][ID], 0xFF0000FF);
    printf("nom %s xmin %s ymin %s", Zones[gzid][Nom], Zones[gzid][Xmin], Zones[gzid][Ymin]);
    return 1;
}
Sorry for my english
Thanks.
Reply
#2

Put GangZoneShowForAll in OnPlayerConnect
Reply
#3

Код:
public OnPlayerConnect(playerid)
{
    for(new i = 0; i < MAX_GANGZONES; i++)
    {
	    GangZoneShowForAll(Zones[i][ID], 0xFF0000FF);
		new string[128];
    	format(string, sizeof(string), "nom %s xmin %s ymin %s xmax %s ymax %s", Zones[i][Nom], Zones[i][Xmin], Zones[i][Ymin], Zones[i][Xmax], Zones[i][Ymax]);
    	SendClientMessage(playerid, COLOR_RED, string);
	}
}
The SendClientMessage gives the correct pos but the gangzone aren't showed/created.
Reply
#4

pawn Код:
dini_Get(path, "Ymax")
Wouldn't be dini_Float ?
Reply
#5

Thanks it works !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)