26.03.2016, 15:55
I'm scripting turf taxes system and got a problem, Whenever I include use of Gangzones[id][gFACTION] (e.g. using its value), It causes UNKNOWN Command and returns 0, anyone knows why?
I tried to debug, It can only show the message pass till 1, I tried before the formaat too and it passed but after format it dont, This is my getfactionname:
teams[id][teamname] value is MAX_STRING (12
and gFACTION of the enumerator _Gangzones is assigned as integer.
Код:
new housesGz[500]; new bizesGz[200]; new moneyGz[100]; for(new gz=0; gz < sizeof(Gangzones); gz++) { housesGz[gz] = 0; bizesGz[gz] = 0; moneyGz[gz] = 10000; for(new hid=0; hid < sizeof(House); hid++) { if(IsCoordsInArea(House[hid][House_x], House[hid][House_y], Gangzones[gz][maxX], Gangzones[gz][minX], Gangzones[gz][maxY], Gangzones[gz][minY ])) { housesGz[gz]++; } } for(new bid=0; bid < sizeof(biz); bid++) { if(IsCoordsInArea(biz[bid][bizenter_x], biz[bid][bizenter_y], Gangzones[gz][maxX], Gangzones[gz][minX], Gangzones[gz][maxY], Gangzones[gz][minY])) { bizesGz[gz]++; } } SendClientMessage(playerid, COLOR_RED, "Pass till 1"); if(Gangzones[gz][gFACTION] != 255 || Gangzones[gz][gFACTION] != -1 || Gangzones[gz][gFACTION] != 0) { moneyGz[gz] = housesGz[gz] + bizesGz[gz] * 12500; new fcabankx[128], fcabank; format(fcabankx,sizeof(fcabankx),"%sBank",GetFactionName(Gangzones[gz][gFACTION])); SendClientMessage(playerid, COLOR_RED, "Pass till 2"); fcabank = dini_Int(globalstats,fcabankx); dini_IntSet(globalstats, fcabankx, fcabank + moneyGz[gz]); SendClientMessage(playerid, COLOR_RED, "Pass till 3"); printf("[DEBUG] Faction %s turf money set!",GetFactionName(Gangzones[gz][gFACTION])); } }
Код:
stock GetFactionName ( factionid ) { return teams[ GetTeam(factionid) ][teamname]; }
and gFACTION of the enumerator _Gangzones is assigned as integer.