Something goes wrong with plugin streamer. -
KaleOtter - 14.03.2011
Ey, I use Incognito plugin streamer.
It always works fantastic, but now I change my pickups to the dynamic pickup function.
And this is what happends,
When I use LoadHouses(); in my gamemode, it successfully load all my houses.
But after this it doesn't load the other stuff in ongamemode.
I show you my loadhouses() public
Код:
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)
{
while(mysql_fetch_row(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;
}
Something wrong here?
Re: Something goes wrong with plugin streamer. - XFlawless - 14.03.2011
You are not looping the House pickups.
Re: Something goes wrong with plugin streamer. -
KaleOtter - 14.03.2011
Uhm well wierd, because when I use createpickup it works fine, but I will change it and see the result.
Re: Something goes wrong with plugin streamer. -
KaleOtter - 14.03.2011
Uhm well it didn't work on the ways I tried, How me an example how you used to do it, please.
Re: Something goes wrong with plugin streamer. - XFlawless - 14.03.2011
pawn Код:
for(new h = 0; h<MAX_HOUSE; h++)
{
CreateDynamicPickup(1272,23,Ent[0],Ent[1],Ent[2],-1,-1,-1,PICKUP_DISTANCE);
}
Just an example.
Re: Something goes wrong with plugin streamer. -
KaleOtter - 14.03.2011
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...
Код:
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:
Код:
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);