Need help!! Failed To Load.... -
pawn Код:
stock SaveHouse(houseid)
{
new string[2048];
format(string, sizeof(string), "UPDATE `houses` SET \
`Owned`=%d, \
`Level`=%d, \
`HInteriorWorld`=%d, \
`Description`='%s', \
`Owner`='%s', \
`ExteriorX`=%f, \
`ExteriorY`=%f, \
`ExteriorZ`=%f, \
`ExteriorR`=%f, \
`InteriorX`=%f, \
`InteriorY`=%f, \
`InteriorZ`=%f, \
`InteriorR`=%f,",
HouseInfo[houseid][hOwned],
HouseInfo[houseid][hLevel],
HouseInfo[houseid][hHInteriorWorld],
HouseInfo[houseid][hDescription],
HouseInfo[houseid][hOwner],
HouseInfo[houseid][hExteriorX],
HouseInfo[houseid][hExteriorY],
HouseInfo[houseid][hExteriorZ],
HouseInfo[houseid][hExteriorR],
HouseInfo[houseid][hInteriorX],
HouseInfo[houseid][hInteriorY],
HouseInfo[houseid][hInteriorZ],
HouseInfo[houseid][hInteriorR]
);
format(string, sizeof(string), "%s \
`Lock`=%d, \
`Rentable`=%d, \
`RentFee`=%d, \
`Value`=%d, \
`SafeMoney`=%d, \
`Pot`=%d, \
`Crack`=%d, \
`Materials`=%d, \
`Weapons0`=%d, \
`Weapons1`=%d, \
`Weapons2`=%d, \
`Weapons3`=%d, \
`Weapons4`=%d, \
`GLUpgrade`=%d, \
`CustomInterior`=%d, \
`CustomExterior`=%d, \
`ExteriorA`=%f, \
`InteriorA`=%f WHERE `id`=%d",
string,
HouseInfo[houseid][hLock],
HouseInfo[houseid][hRentable],
HouseInfo[houseid][hRentFee],
HouseInfo[houseid][hValue],
HouseInfo[houseid][hSafeMoney],
HouseInfo[houseid][hPot],
HouseInfo[houseid][hCrack],
HouseInfo[houseid][hMaterials],
HouseInfo[houseid][hWeapons][0],
HouseInfo[houseid][hWeapons][1],
HouseInfo[houseid][hWeapons][2],
HouseInfo[houseid][hWeapons][3],
HouseInfo[houseid][hWeapons][4],
HouseInfo[houseid][hGLUpgrade],
HouseInfo[houseid][hCustomInterior],
HouseInfo[houseid][hCustomExterior],
HouseInfo[houseid][hExteriorA],
HouseInfo[houseid][hInteriorA],
houseid+1
); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
stock SaveHouses()
{
for(new i = 0; i < MAX_HOUSES; i++)
{
SaveHouse(i);
}
return 1;
}
stock RehashHouse(houseid)
{
printf("[RehashHouse] Deleting HouseID %d from server...", houseid);
DestroyPickupEx(HouseInfo[houseid][hPickupID]);
if(IsValidDynamic3DTextLabel(HouseInfo[houseid][hTextID])) DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
HouseInfo[houseid][hSQLId] = -1;
HouseInfo[houseid][hOwned] = 0;
HouseInfo[houseid][hLevel] = 0;
HouseInfo[houseid][hHInteriorWorld] = 0;
HouseInfo[houseid][hExteriorX] = 0.0;
HouseInfo[houseid][hExteriorY] = 0.0;
HouseInfo[houseid][hExteriorZ] = 0.0;
HouseInfo[houseid][hExteriorR] = 0.0;
HouseInfo[houseid][hInteriorX] = 0.0;
HouseInfo[houseid][hInteriorY] = 0.0;
HouseInfo[houseid][hInteriorZ] = 0.0;
HouseInfo[houseid][hInteriorR] = 0.0;
HouseInfo[houseid][hLock] = 0;
HouseInfo[houseid][hRentable] = 0;
HouseInfo[houseid][hRentFee] = 0;
HouseInfo[houseid][hValue] = 0;
HouseInfo[houseid][hSafeMoney] = 0;
HouseInfo[houseid][hPot] = 0;
HouseInfo[houseid][hCrack] = 0;
HouseInfo[houseid][hMaterials] = 0;
HouseInfo[houseid][hWeapons][0] = 0;
HouseInfo[houseid][hWeapons][1] = 0;
HouseInfo[houseid][hWeapons][2] = 0;
HouseInfo[houseid][hWeapons][3] = 0;
HouseInfo[houseid][hWeapons][4] = 0;
HouseInfo[houseid][hGLUpgrade] = 0;
HouseInfo[houseid][hCustomInterior] = 0;
HouseInfo[houseid][hCustomExterior] = 0;
HouseInfo[houseid][hExteriorA] = 0;
HouseInfo[houseid][hInteriorA] = 0;
LoadHouse(houseid);
}
stock RehashHouses()
{
printf("[RehashHouses] Deleting houses from server...");
for(new i = 0; i < MAX_HOUSES; i++)
{
DestroyPickupEx(HouseInfo[i][hPickupID]);
if(IsValidDynamic3DTextLabel(HouseInfo[i][hTextID])) DestroyDynamic3DTextLabel(HouseInfo[i][hTextID]);
HouseInfo[i][hSQLId] = -1;
HouseInfo[i][hOwned] = 0;
HouseInfo[i][hLevel] = 0;
HouseInfo[i][hHInteriorWorld] = 0;
HouseInfo[i][hExteriorX] = 0.0;
HouseInfo[i][hExteriorY] = 0.0;
HouseInfo[i][hExteriorZ] = 0.0;
HouseInfo[i][hExteriorR] = 0.0;
HouseInfo[i][hInteriorX] = 0.0;
HouseInfo[i][hInteriorY] = 0.0;
HouseInfo[i][hInteriorZ] = 0.0;
HouseInfo[i][hInteriorR] = 0.0;
HouseInfo[i][hLock] = 0;
HouseInfo[i][hRentable] = 0;
HouseInfo[i][hRentFee] = 0;
HouseInfo[i][hValue] = 0;
HouseInfo[i][hSafeMoney] = 0;
HouseInfo[i][hPot] = 0;
HouseInfo[i][hCrack] = 0;
HouseInfo[i][hMaterials] = 0;
HouseInfo[i][hWeapons][0] = 0;
HouseInfo[i][hWeapons][1] = 0;
HouseInfo[i][hWeapons][2] = 0;
HouseInfo[i][hWeapons][3] = 0;
HouseInfo[i][hWeapons][4] = 0;
HouseInfo[i][hGLUpgrade] = 0;
HouseInfo[i][hCustomInterior] = 0;
HouseInfo[i][hCustomExterior] = 0;
HouseInfo[i][hExteriorA] = 0;
HouseInfo[i][hInteriorA] = 0;
}
LoadHouses();
}
stock LoadHouse(houseid)
{
new string[128];
printf("[LoadHouse] Loading HouseID %d's data from database...", houseid);
format(string, sizeof(string), "SELECT * FROM `houses` WHERE `id`=%d",houseid+1); // Array starts at zero, MySQL starts at one.
mysql_function_query(MainPipeline, string, true, "OnLoadHouse", "i", houseid);
}
forward OnLoadHouse(index);
public OnLoadHouse(index)
{
new string[64];
new rows, fields;
cache_get_data(rows, fields, MainPipeline);
for(new field;field<fields;field++)
{
cache_get_row(index, field, string, MainPipeline);
switch(field)
{
case 0: HouseInfo[index][hSQLId] = strval(string);
case 1: HouseInfo[index][hOwned] = strval(string);
case 2: HouseInfo[index][hLevel] = strval(string);
case 3: HouseInfo[index][hHInteriorWorld] = strval(string);
case 4: format(HouseInfo[index][hDescription], 16, "%s", string);
case 5: format(HouseInfo[index][hOwner], 24, "%s", string);
case 6: HouseInfo[index][hExteriorX] = floatstr(string);
case 7: HouseInfo[index][hExteriorY] = floatstr(string);
case 8: HouseInfo[index][hExteriorZ] = floatstr(string);
case 9: HouseInfo[index][hExteriorR] = floatstr(string);
case 10: HouseInfo[index][hInteriorX] = floatstr(string);
case 11: HouseInfo[index][hInteriorY] = floatstr(string);
case 12: HouseInfo[index][hInteriorZ] = floatstr(string);
case 13: HouseInfo[index][hInteriorR] = floatstr(string);
case 14: HouseInfo[index][hLock] = strval(string);
case 15: HouseInfo[index][hRentable] = strval(string);
case 16: HouseInfo[index][hRentFee] = strval(string);
case 17: HouseInfo[index][hValue] = strval(string);
case 18: HouseInfo[index][hSafeMoney] = strval(string);
case 19: HouseInfo[index][hPot] = strval(string);
case 20: HouseInfo[index][hCrack] = strval(string);
case 21: HouseInfo[index][hMaterials] = strval(string);
case 22: HouseInfo[index][hWeapons][0] = strval(string);
case 23: HouseInfo[index][hWeapons][1] = strval(string);
case 24: HouseInfo[index][hWeapons][2] = strval(string);
case 25: HouseInfo[index][hWeapons][3] = strval(string);
case 26: HouseInfo[index][hWeapons][4] = strval(string);
case 27: HouseInfo[index][hGLUpgrade] = strval(string);
case 28: HouseInfo[index][hPickupID] = strval(string);
case 29: HouseInfo[index][hCustomInterior] = strval(string);
case 30: HouseInfo[index][hCustomExterior] = strval(string);
case 31: HouseInfo[index][hExteriorA] = floatstr(string);
case 32: HouseInfo[index][hInteriorA] = floatstr(string);
}
}
if(HouseInfo[index][hOwned]) {
if(!HouseInfo[index][hRentable]) format(string, sizeof(string), "This house is owned by\n%s\nLevel: %d\nID: %d",HouseInfo[index][hOwner], HouseInfo[index][hLevel], index);
else format(string, sizeof(string), "This house is owned by\n%s\nRent: $%d\nLevel: %d\nID: %d\nType /rentroom to rent a room", HouseInfo[index][hOwner], HouseInfo[index][hRentFee], HouseInfo[index][hLevel], index);
}
else format(string, sizeof(string), "This house is\n for sale!\n Description: %s\nCost: $%d\n Level: %d\nID: %d\nTo buy this house type /buyhouse",HouseInfo[index][hDescription],HouseInfo[index][hValue],HouseInfo[index][hLevel],index);
HouseInfo[index][hPickupID] = CreatePickupEx(1273, 23, HouseInfo[index][hExteriorX], HouseInfo[index][hExteriorY], HouseInfo[index][hExteriorZ]);
HouseInfo[index][hTextID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, HouseInfo[index][hExteriorX], HouseInfo[index][hExteriorY], HouseInfo[index][hExteriorZ]+0.5,10.0, .testlos = 1, .streamdistance = 10.0);
return 1;
}
stock LoadHouses()
{
printf("[LoadHouses] Loading data from database...");
mysql_function_query(MainPipeline, "SELECT * FROM `houses`", true, "OnLoadHouses", "");
}
forward OnLoadHouses();
public OnLoadHouses()
{
new string[512], iIndex;
new rows, fields;
cache_get_data(rows, fields, MainPipeline);
while(iIndex<rows)
{
for(new field;field<fields;field++)
{
cache_get_row(iIndex, field, string, MainPipeline);
switch(field)
{
case 0: HouseInfo[iIndex][hSQLId] = strval(string);
case 1: HouseInfo[iIndex][hOwned] = strval(string);
case 2: HouseInfo[iIndex][hLevel] = strval(string);
case 3: HouseInfo[iIndex][hHInteriorWorld] = strval(string);
case 4: format(HouseInfo[iIndex][hDescription], 16, "%s", string);
case 5: format(HouseInfo[iIndex][hOwner], 24, "%s", string);
case 6: HouseInfo[iIndex][hExteriorX] = floatstr(string);
case 7: HouseInfo[iIndex][hExteriorY] = floatstr(string);
case 8: HouseInfo[iIndex][hExteriorZ] = floatstr(string);
case 9: HouseInfo[iIndex][hExteriorR] = floatstr(string);
case 10: HouseInfo[iIndex][hInteriorX] = floatstr(string);
case 11: HouseInfo[iIndex][hInteriorY] = floatstr(string);
case 12: HouseInfo[iIndex][hInteriorZ] = floatstr(string);
case 13: HouseInfo[iIndex][hInteriorR] = floatstr(string);
case 14: HouseInfo[iIndex][hLock] = strval(string);
case 15: HouseInfo[iIndex][hRentable] = strval(string);
case 16: HouseInfo[iIndex][hRentFee] = strval(string);
case 17: HouseInfo[iIndex][hValue] = strval(string);
case 18: HouseInfo[iIndex][hSafeMoney] = strval(string);
case 19: HouseInfo[iIndex][hPot] = strval(string);
case 20: HouseInfo[iIndex][hCrack] = strval(string);
case 21: HouseInfo[iIndex][hMaterials] = strval(string);
case 22: HouseInfo[iIndex][hWeapons][0] = strval(string);
case 23: HouseInfo[iIndex][hWeapons][1] = strval(string);
case 24: HouseInfo[iIndex][hWeapons][2] = strval(string);
case 25: HouseInfo[iIndex][hWeapons][3] = strval(string);
case 26: HouseInfo[iIndex][hWeapons][4] = strval(string);
case 27: HouseInfo[iIndex][hGLUpgrade] = strval(string);
case 28: HouseInfo[iIndex][hPickupID] = strval(string);
case 29: HouseInfo[iIndex][hCustomInterior] = strval(string);
case 30: HouseInfo[iIndex][hCustomExterior] = strval(string);
case 31: HouseInfo[iIndex][hExteriorA] = floatstr(string);
case 32: HouseInfo[iIndex][hInteriorA] = floatstr(string);
}
}
if(HouseInfo[iIndex][hOwned]) {
if(!HouseInfo[iIndex][hRentable]) format(string, sizeof(string), "This house is owned by\n%s\nLevel: %d\nID: %d",HouseInfo[iIndex][hOwner], HouseInfo[iIndex][hLevel], iIndex);
else format(string, sizeof(string), "This house is owned by\n%s\nRent: $%d\nLevel: %d\nID: %d\nType /rentroom to rent a room", HouseInfo[iIndex][hOwner], HouseInfo[iIndex][hRentFee], HouseInfo[iIndex][hLevel], iIndex);
}
else format(string, sizeof(string), "This house is\n for sale!\n Description: %s\nCost: $%d\n Level: %d\nID: %d\nTo buy this house type /buyhouse",HouseInfo[iIndex][hDescription],HouseInfo[iIndex][hValue],HouseInfo[iIndex][hLevel],iIndex);
HouseInfo[iIndex][hPickupID] = CreatePickupEx(1273, 23, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]);
HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,10.0, .testlos = 1, .streamdistance = 10.0);
iIndex++;
}
if(iIndex > 0) printf("[LoadHouses] %d houses rehashed/loaded.", iIndex);
else printf("[LoadHouses] Failed to load any houses.");
return 1;
}
pawn Код:
stock CreateDynamicDoor(doorid)
{
new string[128];
format(string, sizeof(string), "%s\nID: %d",DDoorsInfo[doorid][ddDescription],doorid);
switch(DDoorsInfo[doorid][ddColor])
{
case -1:{ /* Disable 3d Textdraw */ }
case 1:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWWHITE, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 2:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWPINK, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 3:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWRED, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 4:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWBROWN, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 5:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWGRAY, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 6:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWOLIVE, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 7:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWPURPLE, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 8:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWORANGE, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 9:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWAZURE, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 10:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWGREEN, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 11:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWBLUE, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
case 12:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWBLACK, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
default:{DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);}
}
switch(DDoorsInfo[doorid][ddPickupModel])
{
case -1: { /* Disable Pickup */ }
case 1:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1210, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 2:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1212, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 3:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1239, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 4:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1240, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 5:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1241, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 6:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1242, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 7:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1247, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 8:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1248, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 9:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1252, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 10:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1253, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 11:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1254, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 12:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1313, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 13:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1272, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 14:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1273, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 15:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1274, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 16:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1275, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 17:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1276, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 18:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1277, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 19:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1279, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 20:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1314, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 21:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1316, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 22:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1317, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 23:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1559, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 24:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1582, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
case 25:{DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(2894, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);}
default:
{
DDoorsInfo[doorid][ddPickupID] = CreatePickupEx(1318, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);
}
}
}
stock SaveDynamicDoor(doorid)
{
new string[1024];
format(string, sizeof(string), "UPDATE `ddoors` SET \
`Description`='%s', \
`CustomInterior`=%d, \
`ExteriorVW`=%d, \
`ExteriorInt`=%d, \
`InteriorVW`=%d, \
`InteriorInt`=%d, \
`ExteriorX`=%f, \
`ExteriorY`=%f, \
`ExteriorZ`=%f, \
`ExteriorA`=%f, \
`InteriorX`=%f, \
`InteriorY`=%f, \
`InteriorZ`=%f, \
`InteriorA`=%f,",
g_mysql_ReturnEscaped(DDoorsInfo[doorid][ddDescription], MainPipeline),
DDoorsInfo[doorid][ddCustomInterior],
DDoorsInfo[doorid][ddExteriorVW],
DDoorsInfo[doorid][ddExteriorInt],
DDoorsInfo[doorid][ddInteriorVW],
DDoorsInfo[doorid][ddInteriorInt],
DDoorsInfo[doorid][ddExteriorX],
DDoorsInfo[doorid][ddExteriorY],
DDoorsInfo[doorid][ddExteriorZ],
DDoorsInfo[doorid][ddExteriorA],
DDoorsInfo[doorid][ddInteriorX],
DDoorsInfo[doorid][ddInteriorY],
DDoorsInfo[doorid][ddInteriorZ],
DDoorsInfo[doorid][ddInteriorA]
);
format(string, sizeof(string), "%s \
`CustomExterior`=%d, \
`VIP`=%d, \
`Family`=%d, \
`Faction`=%d, \
`Admin`=%d, \
`Wanted`=%d, \
`VehicleAble`=%d, \
`Color`=%d, \
`PickupModel`=%d, \
`Pass`='%s', \
`Locked`=%d WHERE `id`=%d",
string,
DDoorsInfo[doorid][ddCustomExterior],
DDoorsInfo[doorid][ddVIP],
DDoorsInfo[doorid][ddFamily],
DDoorsInfo[doorid][ddFaction],
DDoorsInfo[doorid][ddAdmin],
DDoorsInfo[doorid][ddWanted],
DDoorsInfo[doorid][ddVehicleAble],
DDoorsInfo[doorid][ddColor],
DDoorsInfo[doorid][ddPickupModel],
g_mysql_ReturnEscaped(DDoorsInfo[doorid][dPass], MainPipeline),
DDoorsInfo[doorid][dLocked],
doorid+1
); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
stock SaveDynamicDoors()
{
for(new i = 0; i < MAX_DDOORS; i++)
{
SaveDynamicDoor(i);
}
return 1;
}
stock RehashDynamicDoor(doorid)
{
printf("[RehashDynamicDoor] Deleting DDoorID %d from server...", doorid);
DestroyPickupEx(DDoorsInfo[doorid][ddPickupID]);
if(IsValidDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DDoorsInfo[doorid][ddTextID]);
DDoorsInfo[doorid][ddSQLId] = -1;
DDoorsInfo[doorid][ddCustomInterior] = 0;
DDoorsInfo[doorid][ddExteriorVW] = 0;
DDoorsInfo[doorid][ddExteriorInt] = 0;
DDoorsInfo[doorid][ddInteriorVW] = 0;
DDoorsInfo[doorid][ddInteriorInt] = 0;
DDoorsInfo[doorid][ddExteriorX] = 0.0;
DDoorsInfo[doorid][ddExteriorY] = 0.0;
DDoorsInfo[doorid][ddExteriorZ] = 0.0;
DDoorsInfo[doorid][ddExteriorA] = 0.0;
DDoorsInfo[doorid][ddInteriorX] = 0.0;
DDoorsInfo[doorid][ddInteriorY] = 0.0;
DDoorsInfo[doorid][ddInteriorZ] = 0.0;
DDoorsInfo[doorid][ddInteriorA] = 0.0;
DDoorsInfo[doorid][ddCustomExterior] = 0;
DDoorsInfo[doorid][ddVIP] = 0;
DDoorsInfo[doorid][ddFamily] = 0;
DDoorsInfo[doorid][ddFaction] = 0;
DDoorsInfo[doorid][ddAdmin] = 0;
DDoorsInfo[doorid][ddWanted] = 0;
DDoorsInfo[doorid][ddVehicleAble] = 0;
DDoorsInfo[doorid][ddColor] = 0;
DDoorsInfo[doorid][ddPickupModel] = 0;
DDoorsInfo[doorid][dLocked] = 0;
LoadDynamicDoor(doorid);
}
stock RehashDynamicDoors()
{
printf("[RehashDynamicDoors] Deleting dynamic doors from server...");
for(new i = 0; i < MAX_DDOORS; i++)
{
DestroyPickupEx(DDoorsInfo[i][ddPickupID]);
if(IsValidDynamic3DTextLabel(DDoorsInfo[i][ddTextID])) DestroyDynamic3DTextLabel(DDoorsInfo[i][ddTextID]);
DDoorsInfo[i][ddSQLId] = -1;
DDoorsInfo[i][ddCustomInterior] = 0;
DDoorsInfo[i][ddExteriorVW] = 0;
DDoorsInfo[i][ddExteriorInt] = 0;
DDoorsInfo[i][ddInteriorVW] = 0;
DDoorsInfo[i][ddInteriorInt] = 0;
DDoorsInfo[i][ddExteriorX] = 0.0;
DDoorsInfo[i][ddExteriorY] = 0.0;
DDoorsInfo[i][ddExteriorZ] = 0.0;
DDoorsInfo[i][ddExteriorA] = 0.0;
DDoorsInfo[i][ddInteriorX] = 0.0;
DDoorsInfo[i][ddInteriorY] = 0.0;
DDoorsInfo[i][ddInteriorZ] = 0.0;
DDoorsInfo[i][ddInteriorA] = 0.0;
DDoorsInfo[i][ddCustomExterior] = 0;
DDoorsInfo[i][ddVIP] = 0;
DDoorsInfo[i][ddFamily] = 0;
DDoorsInfo[i][ddFaction] = 0;
DDoorsInfo[i][ddAdmin] = 0;
DDoorsInfo[i][ddWanted] = 0;
DDoorsInfo[i][ddVehicleAble] = 0;
DDoorsInfo[i][ddColor] = 0;
DDoorsInfo[i][ddPickupModel] = 0;
DDoorsInfo[i][dLocked] = 0;
}
LoadDynamicDoors();
}
stock LoadDynamicDoor(doorid)
{
new string[128];
printf("[LoadDynamicDoor] Loading DDoorID %d's data from database...", doorid);
format(string, sizeof(string), "SELECT * FROM `ddoors` WHERE `id`=%d", doorid+1); // Array starts at zero, MySQL starts at 1.
mysql_function_query(MainPipeline, string, true, "OnLoadDynamicDoor", "i", doorid);
}
forward OnLoadDynamicDoor(index);
public OnLoadDynamicDoor(index)
{
new string[512];
new rows, fields;
cache_get_data(rows, fields, MainPipeline);
for(new field;field<fields;field++)
{
cache_get_row(index, field, string, MainPipeline);
switch(field)
{
case 0: DDoorsInfo[index][ddSQLId] = strval(string);
case 1: format(DDoorsInfo[index][ddDescription], 128, "%s", string);
case 2: DDoorsInfo[index][ddCustomInterior] = strval(string);
case 3: DDoorsInfo[index][ddExteriorVW] = strval(string);
case 4: DDoorsInfo[index][ddExteriorInt] = strval(string);
case 5: DDoorsInfo[index][ddInteriorVW] = strval(string);
case 6: DDoorsInfo[index][ddInteriorInt] = strval(string);
case 7: DDoorsInfo[index][ddExteriorX] = floatstr(string);
case 8: DDoorsInfo[index][ddExteriorY] = floatstr(string);
case 9: DDoorsInfo[index][ddExteriorZ] = floatstr(string);
case 10: DDoorsInfo[index][ddExteriorA] = floatstr(string);
case 11: DDoorsInfo[index][ddInteriorX] = floatstr(string);
case 12: DDoorsInfo[index][ddInteriorY] = floatstr(string);
case 13: DDoorsInfo[index][ddInteriorZ] = floatstr(string);
case 14: DDoorsInfo[index][ddInteriorA] = floatstr(string);
case 15: DDoorsInfo[index][ddCustomExterior] = strval(string);
case 16: DDoorsInfo[index][ddVIP] = strval(string);
case 17: DDoorsInfo[index][ddFamily] = strval(string);
case 18: DDoorsInfo[index][ddFaction] = strval(string);
case 19: DDoorsInfo[index][ddAdmin] = strval(string);
case 20: DDoorsInfo[index][ddWanted] = strval(string);
case 21: DDoorsInfo[index][ddVehicleAble] = strval(string);
case 22: DDoorsInfo[index][ddColor] = strval(string);
case 23: DDoorsInfo[index][ddPickupModel] = strval(string);
case 24: format(DDoorsInfo[index][dPass], 24, "%s", string);
case 25: DDoorsInfo[index][dLocked] = strval(string);
}
}
if(!isnull(DDoorsInfo[index][ddDescription])) CreateDynamicDoor(index);
return 1;
}
stock LoadDynamicDoors()
{
printf("[LoadDynamicDoors] Loading data from database...");
mysql_function_query(MainPipeline, "SELECT * FROM `ddoors`", true, "OnLoadDynamicDoors", "");
}
forward OnLoadDynamicDoors();
public OnLoadDynamicDoors()
{
new string[512], iIndex = 0;
new rows, fields;
cache_get_data(rows, fields, MainPipeline);
while(iIndex<rows)
{
for(new field;field<fields;field++)
{
cache_get_row(iIndex, field, string, MainPipeline);
switch(field)
{
case 0: DDoorsInfo[iIndex][ddSQLId] = strval(string);
case 1: format(DDoorsInfo[iIndex][ddDescription], 128, "%s", string);
case 2: DDoorsInfo[iIndex][ddCustomInterior] = strval(string);
case 3: DDoorsInfo[iIndex][ddExteriorVW] = strval(string);
case 4: DDoorsInfo[iIndex][ddExteriorInt] = strval(string);
case 5: DDoorsInfo[iIndex][ddInteriorVW] = strval(string);
case 6: DDoorsInfo[iIndex][ddInteriorInt] = strval(string);
case 7: DDoorsInfo[iIndex][ddExteriorX] = floatstr(string);
case 8: DDoorsInfo[iIndex][ddExteriorY] = floatstr(string);
case 9: DDoorsInfo[iIndex][ddExteriorZ] = floatstr(string);
case 10: DDoorsInfo[iIndex][ddExteriorA] = floatstr(string);
case 11: DDoorsInfo[iIndex][ddInteriorX] = floatstr(string);
case 12: DDoorsInfo[iIndex][ddInteriorY] = floatstr(string);
case 13: DDoorsInfo[iIndex][ddInteriorZ] = floatstr(string);
case 14: DDoorsInfo[iIndex][ddInteriorA] = floatstr(string);
case 15: DDoorsInfo[iIndex][ddCustomExterior] = strval(string);
case 16: DDoorsInfo[iIndex][ddVIP] = strval(string);
case 17: DDoorsInfo[iIndex][ddFamily] = strval(string);
case 18: DDoorsInfo[iIndex][ddFaction] = strval(string);
case 19: DDoorsInfo[iIndex][ddAdmin] = strval(string);
case 20: DDoorsInfo[iIndex][ddWanted] = strval(string);
case 21: DDoorsInfo[iIndex][ddVehicleAble] = strval(string);
case 22: DDoorsInfo[iIndex][ddColor] = strval(string);
case 23: DDoorsInfo[iIndex][ddPickupModel] = strval(string);
case 24: format(DDoorsInfo[iIndex][dPass], 24, "%s", string);
case 25: DDoorsInfo[iIndex][dLocked] = strval(string);
}
}
if(!isnull(DDoorsInfo[iIndex][ddDescription])) CreateDynamicDoor(iIndex);
iIndex++;
}
if(iIndex > 0) printf("[LoadDynamicDoors] %d doors rehashed/loaded.", iIndex);
else printf("[LoadDynamicDoors] Failed to load any doors.");
return 1;
}
Well, if Need another Code or Something tell me with reply!! That's Codes im can give now!
Re: Need help!! Failed To Load.... -
Put mysql_debug(1); under OnGameModeInit and then post the house part in you mysql log file that is located in your server directly.
Re: Need help!! Failed To Load.... -
When I post the MySQL_debug(1); OnGameModeInIt then show me in MySQL log file....