14.03.2011, 21:49
Hello,
The problem
The pickup streamer loads my 494 house pickups fantastic,
But when he starts loading my interior pickups, it stops loading at the first pickup.
I will show you my code:
OnGameModeInit
So when he succesfully loaded LoadHouses(); he starts to load LoadInteriors();
Load Interiors:
But when is comes at CreateDynamicPickup he stops loading, and he also doesn't load the rest of OnGameModeInit.
I'm sure the CreateDynamicPickup is correct and he loads 494 house pickups so the streamer also works fine except this wierd thing...
Maybe you need LoadHouses().
Here it is:
If somebody know how to solve this problem please explain it to me, because i get sick of it.
Thanks.
The problem
The pickup streamer loads my 494 house pickups fantastic,
But when he starts loading my interior pickups, it stops loading at the first pickup.
I will show you my code:
OnGameModeInit
Код:
public OnGameModeInit() { LoadServerStats(); LoadTextDraws(); LoadVehicles(); LoadHouses(); LoadInteriors(); LoadFactions(); return 1; }
Load Interiors:
Код:
public LoadInteriors() { print("debuginteriors"); new pickup; new interiornumber,interiorpickup,interiorfee,interiortype,interior,mapicon,Float:Ent[3],Float:Ext[3],name[32]; mysql_query("SELECT * FROM `interiors`"); mysql_store_result(); printf("%d interiors loaded",mysql_num_rows()); if(mysql_num_rows() > 0) { for(new h = 0; h<mysql_num_rows(); h++) { mysql_fetch_row_format(InteriorQuery, "|"); sscanf(InteriorQuery, "p<|>ddffffffdddds[32]", interiornumber, interiorpickup, Ent[0], Ent[1], Ent[2], Ext[0], Ext[1], Ext[2], interiorfee, interiortype, interior, mapicon, name); pickup = CreateDynamicPickup(interiorpickup,23,Ent[0],Ent[1],Ent[2]+0.5,-1,-1,-1,PICKUP_DISTANCE); PickupType[pickup] = ServerPickup; iStats[pickup][InteriorNumber] = interiornumber; if(iStats[pickup][InteriorNumber] != 0) { iStats[pickup][IntModel] = interiorpickup; iStats[pickup][EntX] = Ent[0]; iStats[pickup][EntY] = Ent[1]; iStats[pickup][EntZ] = Ent[2]; iStats[pickup][ExtX] = Ext[0]; iStats[pickup][ExtY] = Ext[1]; iStats[pickup][ExtZ] = Ext[2]; iStats[pickup][IntFee] = interiorfee; iStats[pickup][IntType] = interiortype; iStats[pickup][Int] = interior; iStats[pickup][IntMap] = mapicon; format(iStats[pickup][IntName],52,name); } } } print("debuginteriors2"); mysql_free_result(); return 1; }
I'm sure the CreateDynamicPickup is correct and he loads 494 house pickups so the streamer also works fine except this wierd thing...
Maybe you need LoadHouses().
Here it is:
Код:
public LoadHouses() { new pickup; new housebought,housenumber,houseinterior,houseprice,houselock,Float:Ent[3],Float:Ext[3],ownername[26]; mysql_query("SELECT * FROM `houses`"); mysql_store_result(); printf("%d houses loaded",mysql_num_rows()); if(mysql_num_rows() > 0) { for(new h = 0; h<mysql_num_rows(); h++) { mysql_fetch_row_format(HouseQuery, "|"); sscanf(HouseQuery, "p<|>ddffffffddds[26]", housenumber, housebought, Ent[0], Ent[1], Ent[2], Ext[0], Ext[1], Ext[2], houseinterior, houseprice, houselock, ownername); if(housebought == 1) pickup = CreateDynamicPickup(1272,23,Ent[0],Ent[1],Ent[2],-1,-1,-1,PICKUP_DISTANCE); else pickup = CreateDynamicPickup(1273,23,Ent[0],Ent[1],Ent[2],-1,-1,-1,PICKUP_DISTANCE); PickupType[pickup] = HousePickup; hStats[pickup][HouseNumber] = housenumber; if(hStats[pickup][HouseNumber] != 0) { hStats[pickup][HouseBought] = housebought; hStats[pickup][EntX] = Ent[0]; hStats[pickup][EntY] = Ent[1]; hStats[pickup][EntZ] = Ent[2]; hStats[pickup][ExtX] = Ext[0]; hStats[pickup][ExtY] = Ext[1]; hStats[pickup][ExtZ] = Ext[2]; format(hStats[pickup][Owner] ,sizeof(ownername),ownername); hStats[pickup][HouseInterior] = houseinterior; hStats[pickup][HousePrice] = houseprice; hStats[pickup][HouseLock] = houselock; } } } mysql_free_result(); return 1; }
Thanks.