SA-MP Forums Archive
>Pickup delete on server restart< - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: >Pickup delete on server restart< (/showthread.php?tid=665520)



>Pickup delete on server restart< - Mondialw98 - 07.04.2019

Code:
 CMD:createhouse(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(PlayerInfo[playerid][pAdmin] >= 7)
	{
		new house[64],Float:pX,Float:pY,Float:pZ,string[128],PropertyString[256],query[500];
		if(sscanf(params, "s[64]", house)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /createhouse [exterior/interior/complete]");
	    if(strcmp(house,"exterior",true) == 0)
		{
		    GetPlayerPos(playerid, pX, pY, pZ);
			SetPVarFloat(playerid, "pHeX", pX);
        	SetPVarFloat(playerid, "pHeY", pY);
        	SetPVarFloat(playerid, "pHeZ", pZ);
			SetPVarInt(playerid, "hExt", 1);
			SendClientMessage(playerid, COLOR_YELLOW, "House exterior position configured.");
		}
		if(strcmp(house,"interior",true) == 0)
		{
		    GetPlayerPos(playerid, pX, pY, pZ);
			SetPVarFloat(playerid, "pHiX", pX);
        	SetPVarFloat(playerid, "pHiY", pY);
        	SetPVarFloat(playerid, "pHiZ", pZ);
			SetPVarInt(playerid, "pHiID", GetPlayerInterior(playerid));
			SetPVarInt(playerid, "pHiVW", housess+1);
        	SetPVarInt(playerid, "hInt", 1);
			SendClientMessage(playerid, COLOR_YELLOW, "House interior position configured.");
		}
		if(strcmp(house,"complete",true) == 0)
		{
		    if(GetPVarInt(playerid, "hExt") != 1 || GetPVarInt(playerid, "hInt") != 1)
				return SendClientMessage(playerid, COLOR_ERROR, "(Error){FFFFFF} You haven't configured either the house exterior or interior. Creation attempt failed.");

			new i = housess+1;
			mysql_format(SQL, query, sizeof(query), "INSERT INTO `houses` (`EnterX`, `EnterY`, `EnterZ`, `Price`) VALUES ('%f', '%f', '%f', '%d')", "x, y, z, price");
			mysql_tquery(SQL, query, "", "");

			HouseInfo[i][hID]                           = i;
	    	HouseInfo[i][hEntrancex]                    = GetPVarFloat(playerid, "pHeX");
			HouseInfo[i][hEntrancey]                    = GetPVarFloat(playerid, "pHeY");
		 	HouseInfo[i][hEntrancez]                    = GetPVarFloat(playerid, "pHeZ");
    		HouseInfo[i][hExitx]                        = GetPVarFloat(playerid, "pHiX");
    		HouseInfo[i][hExity]                        = GetPVarFloat(playerid, "pHiY");
    		HouseInfo[i][hExitz]                        = GetPVarFloat(playerid, "pHiZ");
    		format(HouseInfo[i][hOwner], 64, "AdmBot");
    		format(HouseInfo[i][hDiscription], 64, "House");
    		HouseInfo[i][hValue]						= 1000000;
    		HouseInfo[i][hHel]                          = 0;
    		HouseInfo[i][hMusic]						= 0;
    		HouseInfo[i][hInterior]                     = GetPVarInt(playerid, "pHiID");
    		HouseInfo[i][hLock]                         = 0;
    		HouseInfo[i][hOwned]                        = 1;
    		HouseInfo[i][hRent]                         = 5;
    		HouseInfo[i][hRentabil]                     = 1;
    		HouseInfo[i][hTakings]                      = 0;
    		HouseInfo[i][hLevel]                        = 10;
    		HouseInfo[i][hVirtual]                      = GetPVarInt(playerid, "pHiVW");

    		mysql_format(SQL, query, sizeof(query), "UPDATE `houses` SET `Entrancex`='%f',`Entrancey`='%f',`Entrancez`='%f',`Exitx`='%f',`Exity`='%f',`Exitz`='%f',`Interior`='%d',`Virtual`='%d' WHERE `ID`='%d'", HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz], HouseInfo[i][hInterior], HouseInfo[i][hVirtual], i);
    		mysql_tquery(SQL, query, "", "");
    		mysql_format(SQL, query, sizeof(query), "UPDATE `users` SET `House`='%d' WHERE `name`='AdmBot'", i);
    		mysql_tquery(SQL, query, "", "");

    		DeletePVar(playerid, "pHeX");
		    DeletePVar(playerid, "pHeY");
		    DeletePVar(playerid, "pHeZ");
		    DeletePVar(playerid, "pHiX");
		    DeletePVar(playerid, "pHeY");
		    DeletePVar(playerid, "pHeZ");
		    DeletePVar(playerid, "pHiID");
		    DeletePVar(playerid, "pHiVW");
		    DeletePVar(playerid, "pExt");
		    DeletePVar(playerid, "pInt");
            Create3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
			format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}This house is for sale(/buyhouse) ! \n{FFFFFF}Description: {B40404}%s \n{FFFFFF}Price: {B40404}$%s \n{FFFFFF}Level: {B40404}%d",i,HouseInfo[i][hDiscription],FormatNumber(HouseInfo[i][hValue]),HouseInfo[i][hLevel]);
			HouseLabel[i] = Create3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0, 0, 100.0);
			HouseLabel[i] = Create3DTextLabel(PropertyString, 0x008080FF, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 40.0, 0, 0);
			DestroyDynamicPickup(HousePickup[i]);
			HousePickup[i] = AddStaticPickup(1273, 23, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);

			SetPlayerInterior(playerid, 0);
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerPos(playerid, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);
			housess++;
			format(string,sizeof(string),"House %d created!",i);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
	}
	else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
	return 1;
}
After restart pickup and 3DTextLabel is deleted but house still there.


Re: >Pickup delete on server restart< - JasonRiggs - 07.04.2019

Then show your OnGameModeInIt..


Re: >Pickup delete on server restart< - Mondialw98 - 07.04.2019

Code:
// ONGAMEMODEINIT
public OnGameModeInit()
{
	mysql_log(LOG_ERROR | LOG_WARNING, LOG_TYPE_HTML);
	print("------------- SERVER START -------------");
	SQL = mysql_connect("ip", "client", "base", "pass");
	if(mysql_errno() != 0) {
		SetGameModeText("MySQL Error");
		SendRconCommand("password mysqlerror404");
		SendRconCommand("language RO/EN");
		SendRconCommand("hostname For Fuck Sake (mysql connection failed)");
	}
	else 
	{
		new y,m,d,hour,mins,sec,version_text[28];
		getdate(y,m,d);
		gettime(hour,mins,sec);
		if(m==1) format(version_text,sizeof(version_text), "ffs, %d Jan %d",d,y);
		else if(m==2) format(version_text,sizeof(version_text), "ffs, %d Feb %d",d,y);
		else if(m==3) format(version_text,sizeof(version_text), "ffs, %d Mar %d",d,y);
		else if(m==4) format(version_text,sizeof(version_text), "ffs, %d Apr %d",d,y);
		else if(m==5) format(version_text,sizeof(version_text), "ffs, %d May %d",d,y);
		else if(m==6) format(version_text,sizeof(version_text), "ffs, %d Jun %d",d,y);
		else if(m==7) format(version_text,sizeof(version_text), "ffs, %d Jul %d",d,y);
		else if(m==8) format(version_text,sizeof(version_text), "ffs, %d Aug %d",d,y);
		else if(m==9) format(version_text,sizeof(version_text), "ffs, %d Sep %d",d,y);
		else if(m==10) format(version_text,sizeof(version_text), "ffs, %d Oct %d",d,y);
		else if(m==11) format(version_text,sizeof(version_text), "ffs, %d Nov %d",d,y);
		else if(m==12) format(version_text,sizeof(version_text), "ffs, %d Dec %d",d,y);
		SetGameModeText(version_text);
		SendRconCommand("mapname LS - LV");
		SendRconCommand("language RO/EN");
		SendRconCommand("hostname For Fuck Sake RPG | Quest / GiftBox / Recrutam");
		//SendRconCommand("password ffssmek");
		SetNameTagDrawDistance(30);
		EnableStuntBonusForAll(0);
		ShowPlayerMarkers(2);
		LimitPlayerMarkerRadius(5.0);
		SendRconCommand("weather 13");
	    countdown = 0;

		for(new c=0;c<MAX_VEHICLES;c++)
		{
			Gas[c] = GasMax;
		}
		LoadTextdraws();
		LoadSystems();
		LoadAllDynamicObjects();
		LoadAllObjects();
		LoadSTextDraws();
	}



Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

Any idea ?


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

i can create it with /createhouse but after restart is deleted


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

Do you mean how i create the pickup/house or how i do the restart?


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

i dont create it! I create it before the restart and after the server restart is the pickup and 3dtext deleted. That´s it!
When i try to create again, after next server restart i deleted. butt house is still there, only pickup and 3dtext is deleted. i can entry in the house.


Re: >Pickup delete on server restart< - JesterlJoker - 08.04.2019

hmmm... what he meant is how do you load those pickups after the restart...

When you create them, do you do the same thing after the reload like on your OnGameModeInit(); Like maybe it's what you do inside the function LoadTextDraws();

Do you place it on the same location as the house or have mistakenly flipped positions over? like that...


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

Code:
 stock LoadTextdraws()
{
    Date = TextDrawCreate(549.599975, 14.933262, "31.12.2018");
	TextDrawLetterSize(Date, 0.275599, 1.555199);
	TextDrawAlignment(Date, 1);
	TextDrawColor(Date, -1);
	TextDrawSetShadow(Date, 0);
	TextDrawSetOutline(Date, 1);
	TextDrawBackgroundColor(Date, 51);
	TextDrawFont(Date, 2);
	TextDrawSetProportional(Date, 1);

	Time = TextDrawCreate(549.600036, 26.133247, "18:24");
	TextDrawLetterSize(Time, 0.306000, 1.338666);
	TextDrawAlignment(Time, 1);
	TextDrawColor(Time, -1);
	TextDrawSetShadow(Time, 0);
	TextDrawSetOutline(Time, 1);
	TextDrawBackgroundColor(Time, 51);
	TextDrawFont(Time, 2);
	TextDrawSetProportional(Time, 1);
	return 1;
}
This is the stock LoadTextdraws()
I placed them at the same place. It is in the command "CreateDynamicPickup" ...
But i think anythink is missing from my Gamemode because i try another gamemodes and the and the problem is still there! Pickups and Text is not there
Maybe a plugin or someting


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

No !


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

So any command to solve this problem ? i´m realy beginner in powno
I think realy is missing me a plugin or something but ok


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

Code:
 CMD:createbiz(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 6) return 1;
	new type, value, level, idd = bussines+1, Float: Pos[3], query[256];
	if(sscanf(params, "iii", type, value, level)) {
		SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/createbiz <type> <value> <level>");
		SCM(playerid, COLOR_GREY, "(1) Banca, (2) Gun Shop, (3) Club, (4) Sex Shop, (5) Casino, (6) 24/7, (7) Burger Shot, (8) Gym");
		SCM(playerid, COLOR_GREY, "(9) Pizza, (11) Binco, (12) Gas Station, (13) PNS*, (14) Cluckin Bell, (15) CNN, (16) Tuning*");
		return 1;
	}
	if(type == 10 || type < 1) return SCM(playerid, COLOR_GREY, "Invalid type!");
	GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	switch(type) {
		case 1: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '2306', '-16', '27', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 2306; BizzInfo[idd][bExitY] = -16; BizzInfo[idd][bExitZ] = 27;
		}
		case 2: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '316', '-142', '1000', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 316; BizzInfo[idd][bExitY] = -142; BizzInfo[idd][bExitZ] = 1000;
		}
		case 3: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '-794.942', '490.782', '1376.2', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = -794.942; BizzInfo[idd][bExitY] = 490.782; BizzInfo[idd][bExitZ] = 1376.2;
		}
		case 4: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '-100.403', '-24.3921', '1000.72', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = -100.403; BizzInfo[idd][bExitY] = -24.3921; BizzInfo[idd][bExitZ] = 1000.72;
		}
		case 5: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '2015.45', '1017.09', '996.875', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 2015.45; BizzInfo[idd][bExitY] = 1017.09; BizzInfo[idd][bExitZ] = 996.875;
		}
		case 6: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '-31.0246', '-91.3283', '1003.55', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = -31.0246; BizzInfo[idd][bExitY] = -91.3283; BizzInfo[idd][bExitZ] = 1003.55;
		}
		case 7: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '363.134', '-74.8469', '1001.51', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 363.134; BizzInfo[idd][bExitY] = -74.8469; BizzInfo[idd][bExitZ] = 1001.51;
		}
		case 8: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '772.112', '-3.89865', '1000.73', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 772.112; BizzInfo[idd][bExitY] = -3.89865; BizzInfo[idd][bExitZ] = 1000.73;
		}
		case 9: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '372.54', '-133.009', '1001.49', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 372.54; BizzInfo[idd][bExitY] = -133.009; BizzInfo[idd][bExitZ] = 1001.49;
		}
		case 11: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '207.738', '-109.02', '1005.13', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 207.738; BizzInfo[idd][bExitY] = -109.02; BizzInfo[idd][bExitZ] = 1005.13;
		}
		case 12: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
		//case 13: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
		case 14: {
			format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '364.942', '-11.0787', '1001.85', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
			BizzInfo[idd][bExitX] = 364.942; BizzInfo[idd][bExitY] = -11.0787; BizzInfo[idd][bExitZ] = 1001.85;
		}
		case 15: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
		case 16: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
	}
	mysql_tquery(SQL, query, "", "");
	format(query, sizeof(query), "UPDATE `bizz` SET `Virtual`='%d' WHERE `ID`='%d'", idd, idd);
	mysql_tquery(SQL, query, "", "");

	BizzInfo[idd][bEntranceX] = Pos[0];
	BizzInfo[idd][bEntranceY] = Pos[1];
	BizzInfo[idd][bEntranceZ] = Pos[2];
	BizzInfo[idd][bBuyPrice] = value;
	BizzInfo[idd][bLevelNeeded] = level;
	BizzInfo[idd][bVirtual] = idd;
	BizzInfo[idd][bType] = type;
	BizzInfo[idd][bInterior] = BizInteriorID(type);
	if(type >= 12 && type != 14) BizzInfo[idd][bSbiz] = 1;

	new PropertyString[256];
	DestroyDynamic3DTextLabel(BizzLabel[idd]);
	format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{0068CF}This Business is for sale(/buybusiness) ! \n {EEEEEE}Price: {0068CF}%s \n{EEEEEE}Level: {0068CF}%d %s",BizzInfo[idd][bMessage],idd,FormatNumber(BizzInfo[idd][bBuyPrice]),BizzInfo[idd][bLevelNeeded]);
	BizzLabel[idd] = CreateDynamic3DTextLabel(PropertyString ,0x0066FFCC,BizzInfo[idd][bEntranceX], BizzInfo[idd][bEntranceY], BizzInfo[idd][bEntranceZ],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	CreateDynamicPickup(1239, 1, BizzInfo[idd][bEntranceX], BizzInfo[idd][bEntranceY], BizzInfo[idd][bEntranceZ]);
	pickups++;
	bussines++;

	if(BizzInfo[idd][bType] == 1) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],52,0,-1,-1,-1,750.0); //Bank
	if(BizzInfo[idd][bType] == 2) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],18,0,-1,-1,-1,750.0); //GunShop
	if(BizzInfo[idd][bType] == 3) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],49,0,-1,-1,-1,750.0); //Bars
	if(BizzInfo[idd][bType] == 4) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],38,0,-1,-1,-1,750.0); //Sex Shop
	if(BizzInfo[idd][bType] == 5) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],25,0,-1,-1,-1,750.0); //Casino
	if(BizzInfo[idd][bType] == 6) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],17,0,-1,-1,-1,750.0); //24/7
	if(BizzInfo[idd][bType] == 7) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],10,0,-1,-1,-1,750.0); //Burger Shot
	if(BizzInfo[idd][bType] == 8) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],54,0,-1,-1,-1,750.0); //Gym
	if(BizzInfo[idd][bType] == 9) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],29,0,-1,-1,-1,750.0); //Pizza
	if(BizzInfo[idd][bType] == 10) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],51,0,-1,-1,-1,750.0); //Rent Car
	if(BizzInfo[idd][bType] == 11) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],45,0,-1,-1,-1,750.0); //Clothes
	if(BizzInfo[idd][bType] == 12) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],27,0,-1,-1,-1,750.0); //Gas Station
	if(BizzInfo[idd][bType] == 13) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],63,0,-1,-1,-1,750.0); //PNS
	if(BizzInfo[idd][bType] == 14) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],14,0,-1,-1,-1,750.0); //Cluckin Bell

	new string[128];
	format(string, sizeof(string), "[@@ %d @@]%f, %f, %f, [$%s, %d lvl, %d int, %d type]", idd, Pos[0], Pos[1], Pos[2], FormatNumber(value), level, BizInteriorID(type), type);
	SCM(playerid, COLOR_YELLOW, string);
	return 1;
}
Beacouse to this command is showing me the pickup and 3DTextLabel not. But i can entry in this bussines!
Plugin/Scriptfile mission ?


Re: >Pickup delete on server restart< - Mondialw98 - 08.04.2019

Nope, i changed the streamer plugin and bussines pickup is back again, but house pickup ....


Re: >Pickup delete on server restart< - Mondialw98 - 09.04.2019

And how can i solve that ? In SQL is the Pickup not i´m sure. Only the hentryX/y/z hexitx/y/z id price etc.


Re: >Pickup delete on server restart< - Mondialw98 - 09.04.2019

function load_pickup()
or someting ?


Re: >Pickup delete on server restart< - CONTROLA - 09.04.2019

No, Y_Less talks about that function which retrieves information from the database and automatically creates the houses again based on the information in the database.

You should search for something like HouseInfo[i][hID] = .. and get the function which contains that code, or simply look for a function which looks something like "LoadHouses()". Also, you could show us "LoadSystems"


Re: >Pickup delete on server restart< - Mondialw98 - 09.04.2019

He can´t load anything because in the data base is X= 0 Y = 0 z = 0 etc..


Re: >Pickup delete on server restart< - Mondialw98 - 09.04.2019

Code:
 orward OnPropTextdrawUpdate(update, h);
public OnPropTextdrawUpdate(update, h)
{
	new PropertyString[256];
	if(update == 1)
	{
		new type[10],locked[20];
		if(HouseInfo[h][hInteriorType] == 0) format(type, sizeof(type),"Small");
		if(HouseInfo[h][hInteriorType] == 1) format(type, sizeof(type),"Medium");
		if(HouseInfo[h][hInteriorType] == 2) format(type, sizeof(type),"Big");
		if(HouseInfo[h][hLock] == 1) format(locked, sizeof(locked), "\n(locked)");
		if(HouseInfo[h][hOwned] == 0)
		{
			DestroyDynamic3DTextLabel(HouseLabel[h]);
			format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}%s \n{FFFFFF}Size: {B40404}%s \n{FFFFFF}Price: {B40404}$%s (/buyhouse) \n{FFFFFF}Level: {B40404}%d %s",h,HouseInfo[h][hDiscription],type,FormatNumber(HouseInfo[h][hValue]),HouseInfo[h][hLevel],locked);
			HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
			DestroyDynamicPickup(HousePickup[h]);
			HousePickup[h] = CreateDynamicPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
		}
		else if(HouseInfo[h][hOwned] == 1)
		{
			new tenants=0,query[256],selltext[64];
			format(query, sizeof(query), "SELECT * FROM `users` WHERE `Rented` = '%d' AND `Status`='1'", h);
			new Cache: membresult = mysql_query(SQL, query);
			for(new i, j = cache_get_row_count (); i != j; ++i)
			{
				tenants++;
			}
			cache_delete(membresult);
			if(HouseInfo[h][hPrice] > 0)
			{
				format(selltext, sizeof(selltext),"\n{FFFFFF}Price: {B40404}$%s (/buyhouse)",FormatNumber(HouseInfo[h][hPrice]));
			}
			if(HouseInfo[h][hRentabil] == 1)
			{
				DestroyDynamic3DTextLabel(HouseLabel[h]);
				format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}%s \n{FFFFFF}Owner: {B40404}%s \n{FFFFFF}Tenants: {B40404}%d \n{FFFFFF}Size: {B40404}%s \n{FFFFFF}Rent: {B40404}$%d (/rentroom) %s %s",h,HouseInfo[h][hDiscription],HouseInfo[h][hOwner],tenants,type,HouseInfo[h][hRent],selltext,locked);
				HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
				DestroyDynamicPickup(HousePickup[h]);
				HousePickup[h] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
			}
			else
			{
				DestroyDynamic3DTextLabel(HouseLabel[h]);
				format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}%s \n{FFFFFF}Owner: {B40404}%s \n{FFFFFF}Tenants: {B40404}%d \n{FFFFFF}Size: {B40404}%s %s %s",h,HouseInfo[h][hDiscription],HouseInfo[h][hOwner], tenants, type, selltext, locked);
				HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
				DestroyDynamicPickup(HousePickup[h]);
				HousePickup[h] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
			}
		}
	}
	else if(update == 2)
	{
		if(BizzInfo[h][bOwned] == 0)
		{
			DestroyDynamic3DTextLabel(BizzLabel[h]);
			if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n {EEEEEE}Price: {0068CF}$%s (/buybusiness) \n{EEEEEE}Level: {0068CF}%d",BizzInfo[h][bMessage],h,FormatNumber(BizzInfo[h][bBuyPrice]),BizzInfo[h][bLevelNeeded]);
			else format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n {EEEEEE}Price: {0068CF}$%s (/buybusiness) \n{EEEEEE}Level: {0068CF}%d \n(locked)",BizzInfo[h][bMessage],h,FormatNumber(BizzInfo[h][bBuyPrice]),BizzInfo[h][bLevelNeeded]);
			BizzLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x0053CFD1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
		}
		else if(BizzInfo[h][bOwned] == 1)
		{
			DestroyDynamic3DTextLabel(BizzLabel[h]);
			if(BizzInfo[h][bPrice] > 0)
			{
				if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s \n{EEEEEE}Price: {0068CF}$%s (/buybusiness)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]), FormatNumber(BizzInfo[h][bPrice]));
				else format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s \n{EEEEEE}Price: {0068CF}$%s (/buybusiness) \n(locked)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]), FormatNumber(BizzInfo[h][bPrice]));
			}
			else
			{
				if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]));
				else format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s \n(locked)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]));
			}
			BizzLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x0053CFD1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
		}
	}
	return 1;
}
This ?


Re: >Pickup delete on server restart< - CONTROLA - 10.04.2019

I've already told you in the other topic that the positions are saved as 0, 0, 0 because you dont retrieve the player's position inside the pX pY pZ variables. That would be done by using GetPlayerPos(playerid, pX, pY, pZ);

Please follow the introductory tutorials on the SA:MP wiki, those will help you understand the code better.