25.10.2010, 20:15
So I'm trying to create gangzones that can be fought for by rival gangs, (This means the color will change a lot, more than likely). So I have it set save/load the zone's with mysql.
For some reason, the zones show, but they are not the color that they should be(default color being 2B2B2B). Instead they are this VERY faint greyish color, and you won't even see it unless you are concentrating on the map
pawn Код:
stock CreateGangZone(Float:MinX,Float:MinY,Float:MaxX,Float:MaxY)
{
gzcount ++;
new GZ = gzcount, query[120], row[100], field[3][50];
GA[GZ] = CreateDynamicRectangle(MinX,MinY,MaxX,MaxY,-1,-1,-1);
GC[GZ] = GangZoneCreate(MinX,MinY,MaxX,MaxY);
format(query,sizeof(query), "SELECT * FROM `gangzones` WHERE `zoneID`='%d'",GZ);
mysql_check();
mysql_query(query);
mysql_store_result();
if(mysql_num_rows()) {
mysql_fetch_row(row, "|");
explode(row, field, "|");
format(zData[GZ][controler],50, "%s", field[0]);
format(zData[GZ][color],25,"0x%s99",field[2]);
mysql_free_result();
} else {
format(query,sizeof(query), "INSERT INTO `gangzones` (`controler`,`zoneID`,zonecolor) VALUES ('Unclaimed Territory','%d','2B2B2B')",GZ);
format(zData[GZ][controler], 50, "Unclaimed Territory");
format(zData[GZ][color], 25, "0x2B2B2B99");
mysql_check();
mysql_query(query);
mysql_free_result();
}
}
public OnPlayerSpawn(playerid)
{
for(new x;x<MAX_ZONES;x++) {
GangZoneShowForPlayer(playerid, GC[x], zData[x][color]);
}
return 1;
}