06.05.2018, 03:03
stock de carregas as casas:
PHP Code:
stock LoadCasas()
{
for(new i = 0; i < MAX_CASAS; i++)
{
new str[256], Label[256], Status[20], Pick, Pick2;
format(str, sizeof(str), Casas, i);
if(DOF2_FileExists(str))
{
new Casaid;
Casa[Casaid][tDono] = DOF2_GetBool( str, "tDono" );
format(Casa[Casaid][nDono], 24, "%s", DOF2_GetString(str, "nDono") );
Casa[Casaid][cInfo] = DOF2_GetInt ( str, "cInfo" );
Casa[Casaid][cID] = DOF2_GetInt( str, "cID" );
Casa[Casaid][PosX] = DOF2_GetFloat( str, "PosX" );
Casa[Casaid][PosY] = DOF2_GetFloat( str, "PosY" );
Casa[Casaid][PosZ] = DOF2_GetFloat( str, "PosZ" );
Casa[Casaid][cContas] = DOF2_GetInt( str, "cContas" );
Casa[Casaid][cPorta] = DOF2_GetBool( str, "cPorta" );
Casa[Casaid][cInt] = DOF2_GetInt( str, "cInt" );
Casa[Casaid][cWorld] = DOF2_GetInt( str, "cWorld" );
Casa[Casaid][cLevel] = DOF2_GetInt( str, "cLevel" );
if(Casa[Casaid][cPorta] == true) { Status = "{00E600}Aberta"; } else if(Casa[Casaid][cPorta] == false) { Status = "{FF0000}Fechada"; }
format(Label, sizeof(Label), "{c0c0c0}Level %i\nCasa %i\n{FFAE00}Dono: {FFFFFF}%s\n{c0c0c0}Porta: %s", Casa[Casaid][cLevel], Casa[Casaid][cID], Casa[Casaid][nDono], Status);
if(Casa[Casaid][tDono] == true) { Pick2 = 19522; } else if(Casa[Casaid][tDono] == false) { Pick2 = 1273; }
CasaP[Casaid] = CreatePickup(Pick2, 0, Casa[Casaid][PosX], Casa[Casaid][PosY], Casa[Casaid][PosZ], 0);
Create3DTextLabel(Label, -1, Casa[Casaid][PosX], Casa[Casaid][PosY], Casa[Casaid][PosZ], 15.0, 0, 0);
if(Casa[Casaid][tDono] == true) { Pick = 32; } else if(Casa[Casaid][tDono] == false) { Pick = 31; }
CreateDynamicMapIcon(Casa[Casaid][PosX], Casa[Casaid][PosY], Casa[Casaid][PosZ], Pick, -1, -1, -1, -1, 100.0);
}
}
return 1;
}