Hello everyone
I have worked with a house script but the Streamer plugin does not show the house objects ingame. I am running the most recent version of Streamer on a Centos server. This same code worked fine before but it suddently stopped to work (even before I updated).
The same counts for moneybags, they also do not load, and static pickups dissapear when walking into them.
Console prints that houses are loaded.
Moneybag and Cookiejar
How can I recreate this problem?
Regards
Shifty
I have worked with a house script but the Streamer plugin does not show the house objects ingame. I am running the most recent version of Streamer on a Centos server. This same code worked fine before but it suddently stopped to work (even before I updated).
The same counts for moneybags, they also do not load, and static pickups dissapear when walking into them.
Console prints that houses are loaded.
Code:
function LoadHouseData()
{
new h, h_id;
new resultline[600];
mysql_store_result();
while(mysql_fetch_row_format(resultline))
{
sscanf(resultline, "p<|>is[80]s[25]s[80]s[25]fffffffiiiii",
h_id,
hInfo[h][HouseName],
hInfo[h][HouseOwner],
hInfo[h][HouseLocation],
hInfo[h][HousePassword],
hInfo[h][SpawnOutX],
hInfo[h][SpawnOutY],
hInfo[h][SpawnOutZ],
hInfo[h][SpawnOutAngle],
hInfo[h][CPOutX],
hInfo[h][CPOutY],
hInfo[h][CPOutZ],
hInfo[h][HouseValue],
hInfo[h][HouseStorage],
hInfo[h][HouseInterior],
hInfo[h][HousePrivacy],
hInfo[h][HouseForSale]);
//printf("House Owner: %s, House Location: %s House Price: %d House ID: %d", hInfo[h][HouseOwner], hInfo[h][HouseLocation], hInfo[h][HouseValue], h);
// Create House Pickup
CreateCorrectHouseExitCP(h_id);
new labeltext[300];
if(!strcmp(hInfo[h_id][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
{
format(labeltext, sizeof(labeltext), LABELTEXT1, hInfo[h_id][HouseName], ToCurrency(hInfo[h_id][HouseValue]), h_id);
HouseMIcon[h_id] = CreateDynamicMapIcon(hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ], 31, -1, -1, -1, -1, MICON_VD);
HousePickupOut[h_id] = CreateDynamicPickup(PICKUP_MODEL_OUT, PICKUP_TYPE, hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ], -1, -1, -1, 30.0);
}
else if(strcmp(hInfo[h_id][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
{
if(hInfo[h][HouseForSale] != 0)
{
format(labeltext, sizeof(labeltext), LABELTEXT3, hInfo[h_id][HouseName], hInfo[h_id][HouseOwner], ToCurrency(hInfo[h_id][HouseValue]), Answer(hInfo[h_id][HousePrivacy], "Open", "Closed"), h_id, ToCurrency(hInfo[h][HouseForSale]));
HouseMIcon[h_id] = CreateDynamicMapIcon(hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ], 31, -1, -1, -1, -1, MICON_VD);
HousePickupOut[h_id] = CreateDynamicPickup(19524, PICKUP_TYPE, hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ], -1, -1, -1, 30.0);
}
else
{
format(labeltext, sizeof(labeltext), LABELTEXT2, hInfo[h_id][HouseName], hInfo[h_id][HouseOwner], ToCurrency(hInfo[h_id][HouseValue]), Answer(hInfo[h_id][HousePrivacy], "Open", "Closed"), h_id);
HouseMIcon[h_id] = CreateDynamicMapIcon(hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ], 32, -1, -1, -1, -1, MICON_VD);
HousePickupOut[h_id] = CreateDynamicPickup(19522, PICKUP_TYPE, hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ], -1, -1, -1, 30.0);
}
}
HouseLabel[h_id] = CreateDynamic3DTextLabel(labeltext, COLOR_GREEN, hInfo[h_id][CPOutX], hInfo[h_id][CPOutY], hInfo[h_id][CPOutZ]+0.7, TEXTLABEL_DISTANCE, .testlos = 1);
Iter_Add(Houses, h);
h++;
}
mysql_free_result();
// DEBUG
printf("Number of houses loaded: %d", h);
return 1;
}
Code:
function MoneyBag()
{
if(!MoneyBagFound)
{
format(str, sizeof(str), ""MB" "GREEN_E"The Money Bag has still not been found! "LB2_E"Location: %s.", MoneyBagLocation);
SendClientMessageToAll(COLOR_GREEN, str);
SendClientMessageToAll(COLOR_GREEN, ""YELLOW_E"*** "GREEN_E"A new moneybag hunt will start in 5 minutes!");
SetTimer("EndMBHunt", 250000, false);
}
else if(MoneyBagFound)
{
MoneyBagFound = 0;
new randombag = random(sizeof(MBSPAWN));
MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
format(str, sizeof(str), ""MB" "GREEN_E"The Money Bag hunt has started, find it for a prize! "ORANGE_E"Location: %s!", MoneyBagLocation);
SendClientMessageToAll(COLOR_GREEN, str);
MoneyBagStart = GetTickCount();
format(str, sizeof(str), "~g~Money bag hunt has started! ~y~Location: ~r~%s", MoneyBagLocation);
TextDrawSetString(InfoTD2, str);
foreach(Player, ii)
{
if(Speedo[ii] == 1) PlayerTextDrawHide(ii, vSpeed[ii]), TextDrawHideForPlayer(ii, vSpeedBox);
}
TextDrawShowForAll(InfoTD2);
SetTimer("HideInfoTD", 6000, false);
// Update the pickup location
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, mbPC, E_STREAMER_X, MoneyBagPos[0]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, mbPC, E_STREAMER_Y, MoneyBagPos[1]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, mbPC, E_STREAMER_Z, MoneyBagPos[2]);
format(str, sizeof(str), "4Moneybag: 2The Money Bag hunt has started, find it for a prize! Location: %s!", MoneyBagLocation);
IRC_GroupSay(ircGroup, IRC_CHANNEL, str);
}
return 1;
}
function CookieJar()
{
if(CookieJarFound)
{
CookieJarFound = 0;
new randombag = random(sizeof(CJSPAWN));
CookieJarPos[0] = CJSPAWN[randombag][XPOS];
CookieJarPos[1] = CJSPAWN[randombag][YPOS];
CookieJarPos[2] = CJSPAWN[randombag][ZPOS];
format(CookieJarLocation, sizeof(CookieJarLocation), "%s", CJSPAWN[randombag][Position]);
format(str, sizeof(str), ""CJ" "WHITEP_E"The Cookie Jar hunt has started, find it before its gone! "ORANGE_E"Location: %s", CookieJarLocation);
SendClientMessageToAll(COLOR_WHITEP, str);
CookieJarStart = GetTickCount();
format(str, sizeof(str), "~w~Cookie Jar hunt has started! ~r~~h~Location: ~r~%s", CookieJarLocation);
TextDrawSetString(InfoTD2, str);
foreach(Player, ii)
{
if(Speedo[ii] == 1) PlayerTextDrawHide(ii, vSpeed[ii]), TextDrawHideForPlayer(ii, vSpeedBox);
}
TextDrawShowForAll(InfoTD2);
SetTimer("HideInfoTD", 6000, false);
// Update the pickup location
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_X, CookieJarPos[0]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_Y, CookieJarPos[1]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_Z, CookieJarPos[2]);
format(str, sizeof(str), "4Cookie-Jar: 2The Cookie Jar hunt has started, find it for a prize! Location: %s!", CookieJarLocation);
IRC_GroupSay(ircGroup, IRC_CHANNEL, str);
SetTimer("EndCJHunt", 300000, false);
}
return 1;
}
function StartCookieJar()
{
CookieJarFound = 0;
new randombag = random(sizeof(CJSPAWN));
CookieJarPos[0] = CJSPAWN[randombag][XPOS];
CookieJarPos[1] = CJSPAWN[randombag][YPOS];
CookieJarPos[2] = CJSPAWN[randombag][ZPOS];
format(CookieJarLocation, sizeof(CookieJarLocation), "%s", CJSPAWN[randombag][Position]);
format(str, sizeof(str), ""CJ" "WHITEP_E"The Cookie Jar hunt has started, find it before its gone! "ORANGE_E"Location: %s", CookieJarLocation);
SendClientMessageToAll(COLOR_WHITEP, str);
CookieJarStart = GetTickCount();
format(str, sizeof(str), "~w~Cookie Jar hunt has started! ~r~~h~Location: ~r~%s", CookieJarLocation);
TextDrawSetString(InfoTD2, str);
foreach(Player, ii)
{
if(Speedo[ii] == 1) PlayerTextDrawHide(ii, vSpeed[ii]), TextDrawHideForPlayer(ii, vSpeedBox);
}
TextDrawShowForAll(InfoTD2);
SetTimer("HideInfoTD", 6000, false);
// Update the pickup location
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_X, CookieJarPos[0]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_Y, CookieJarPos[1]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_Z, CookieJarPos[2]);
format(str, sizeof(str), "4Cookie-Jar: 2The Cookie Jar hunt has started, find it for a prize! Location: %s!", CookieJarLocation);
IRC_GroupSay(ircGroup, IRC_CHANNEL, str);
SetTimer("EndCJHunt", 300000, false);
return 1;
}
function EndCJHunt()
{
if(!CookieJarFound)
{
format(str, sizeof(str), ""CJ" "WHITEP_E"The Cookie Jar has still not been found! "LB2_E"Location: %s.", CookieJarLocation);
SendClientMessageToAll(COLOR_WHITEP, str);
SendClientMessageToAll(COLOR_WHITEP, ""CJ" "WHITEP_E"The Cookie Jar hunt will end in 10 minutes!");
SetTimer("EndCJHunt2", 600000, false);
}
return 1;
}
function EndCJHunt2()
{
if(!CookieJarFound)
{
CookieJarFound = 1;
CookieJarStart = 0;
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_X, 0.0);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_Y, 0.0);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, cjPC, E_STREAMER_Z, 2140.0);
format(str, sizeof(str), ""CJ" "WHITEP_E"The Cookie Jar hunt has ended! A new one will start in 10 minutes.");
SendClientMessageToAll(COLOR_WHITEP, str);
}
return 1;
}
function HideInfoTD()
{
TextDrawHideForAll(InfoTD2);
foreach(Player, ii)
{
if(Speedo[ii] == 1 && IsPlayerInAnyVehicle(ii)) PlayerTextDrawShow(ii, vSpeed[ii]), TextDrawShowForPlayer(ii, vSpeedBox);
}
}
function EndMBHunt()
{
MoneyBagFound = 0;
new randombag = random(sizeof(MBSPAWN));
MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
format(str, sizeof(str), ""MB" "GREEN_E"The Money Bag hunt has started, find it for a prize! "ORANGE_E"Location: %s!", MoneyBagLocation);
SendClientMessageToAll(COLOR_YELLOW2, str);
MoneyBagStart = GetTickCount();
format(str, sizeof(str), "~g~~h~Money bag hunt has started! ~y~Location: ~r~%s", MoneyBagLocation);
TextDrawSetString(InfoTD2, str);
foreach(Player, ii)
{
if(Speedo[ii] == 1) PlayerTextDrawHide(ii, vSpeed[ii]), TextDrawHideForPlayer(ii, vSpeedBox);
}
TextDrawShowForAll(InfoTD2);
SetTimer("HideInfoTD", 6000, false);
format(str, sizeof(str), "4Moneybag: 2The Money Bag hunt has started, find it for a prize! Location: %s!", MoneyBagLocation);
IRC_GroupSay(ircGroup, IRC_CHANNEL, str);
// Update the pickup location
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, mbPC, E_STREAMER_X, MoneyBagPos[0]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, mbPC, E_STREAMER_Y, MoneyBagPos[1]);
Streamer_SetFloatData(STREAMER_TYPE_PICKUP, mbPC, E_STREAMER_Z, MoneyBagPos[2]);
return 1;
}
Regards
Shifty