Imma make this quick and easy the entity loads but the color does not load
it saves it but doesnt load it correct see any problems?
PHP Code:
LoadBlocks(id)
{
if ( id != 0 && !g_admin[id] )
{
console_print(id, "You have no access to that command");
return PLUGIN_HANDLED;
}
else if ( !file_exists(g_file)
&& 1 <= id <= g_max_players )
{
BCM_Print(id, "Couldn't find file:^1 %s", g_file);
return PLUGIN_HANDLED;
}
if ( 1 <= id <= g_max_players )
{
DeleteAll(id, false);
}
new file;
new data[128];
new light_count;
new type[2];
new origin_x[17];
new origin_y[17];
new origin_z[17];
new property1[5], property2[5], property3[5], property4[5];
new Float:origin[3];
file = fopen(g_file, "rt");
while ( !feof(file) )
{
type = g_blank;
fgets(file, data, charsmax(data));
parse(data,\
type, charsmax(type),\
origin_x, charsmax(origin_x),\
origin_y, charsmax(origin_y),\
origin_z, charsmax(origin_z),\
property1, charsmax(property1),\
property2, charsmax(property2),\
property3, charsmax(property3),\
property4, charsmax(property4)
);
origin[0] = str_to_float(origin_x);
origin[1] = str_to_float(origin_y);
origin[2] = str_to_float(origin_z);
if ( strlen(type) > 0 )
{
switch ( type[0] )
{
case '!':
{
CreateLight(origin, property1, property2, property3, property4);
++light_count;
}
}
if ( type[0] != '!' )
{
CreateLight(origin, property1, property2, property3, property4);
}
}
}
fclose(file);
if ( 1 <= id <= g_max_players )
{
static name[32];
get_user_name(id, name, charsmax(name));
for ( new i = 1; i <= g_max_players; ++i )
{
if ( !g_connected[i]
|| !g_admin[i] ) continue;
BCM_Print(i, "^1%s^3 loaded^1 %d light%s^3! Total entites in map:^1 %d", name, light_count, light_count == 1 ? g_blank : "s", entity_count());
}
}
return PLUGIN_HANDLED;
}
__________________