color loaded from mysql
#1

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.

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;
}
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
Reply


Messages In This Thread
color loaded from mysql - by elcid7772 - 25.10.2010, 20:15
Re: color loaded from mysql - by DVDK - 25.10.2010, 21:33
Re: color loaded from mysql - by elcid7772 - 25.10.2010, 22:30
Re: color loaded from mysql - by DarrenReeder - 25.10.2010, 22:39
Re: color loaded from mysql - by Lookin - 26.10.2010, 00:12
Re: color loaded from mysql - by elcid7772 - 26.10.2010, 21:53
Re: color loaded from mysql - by DVDK - 26.10.2010, 22:36
Re: color loaded from mysql - by Cameltoe - 26.10.2010, 22:40
Re: color loaded from mysql - by elcid7772 - 27.10.2010, 00:13

Forum Jump:


Users browsing this thread: 1 Guest(s)