02.01.2015, 00:32
Hi guys, I just create a hook for CreateGangZone, and my code is :
but give me a error :
but I use another method :
my opinion, GangZoneCreate returns an varible.
but {} method try to create a constant array.
is that reason why my code false to complie?
PHP код:
stock hook_GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy) {
static id = 0;
sZone[id] = {GangZoneCreate(minx, miny, maxx, maxy), minx, miny, maxx, maxy};
id ++;
}
#if defined _ALS_GangZoneCreate
#undef GangZoneCreate
#else
#define _ALS_GangZoneCreate
#endif
#define GangZoneCreate hook_GangZoneCreate
PHP код:
error 008: must be a constant expression; assumed zero;
PHP код:
stock hook_GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy) {
static id = 0;
sZone[id][ID] = GangZoneCreate(minx, miny, maxx, maxy);
sZone[id][MinX] = minx;
sZone[id][MinY] = miny;
sZone[id][MaxX] = maxx;
sZone[id][MaxY] = maxy;
id ++;
}
but {} method try to create a constant array.
is that reason why my code false to complie?