14.03.2011, 15:21
Ow on that way, uhm well thanks, I will try again
Edit: Okay it works, thanks , but still it doesnt load the other things in my ongamemodeinit...
Ongamemodeinit:
Edit: Okay it works, thanks , but still it doesnt load the other things in my ongamemodeinit...
Код:
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; }
Код:
ongamemodeinit.... LoadHouses(); LoadInteriors(); LoadFactions(); printf("%d pickups loaded",CountDynamicPickups()); Create3DTextLabel("/locker",White,2314.7251,-17.3245,27.5880,7.0,0); //__________________________________________________________________________________________________________________________________ . Default Player Settings AddPlayerClass(0, -2339.9487,3230.6035,6.7526,321.2543, 0, 0, 0, 0, 0, 0); //__________________________________________________________________________________________________________________________________ . Server Timers SetTimer("MinuteTimer",60000,true); SetTimer("SecondTimer",1000,true);