Jump to content
  • 0

Problema update pickup.


Bogdan's

Question

Problema intalnita (descriere): Am modificat ca la casele de pe server cele necumparate sa aiba alt pickup(verde) iar cand casa este cumparata sa aiba pickupul galben,la fel si la bizuri albastru respectiv rosu.

Mentionez ca nu am un public care sa updateze automat pickup-urile respective.

Problema este urmatoarea: Cumpar o casa/biz si se restarteaza serverul,dar faza este ca se updateaza,as dori daca se poate sa se updateze pe loc,fara restart-uri...
Ero(area / rile) / warning-(ul / urile): N-am.
Liniile de cod / sursa / script-ul(obligatoriu):

for(new h = 0; h < sizeof(HouseInfo); h++)
	{
	    new bstr[256];
		if(HouseInfo[h][hOwned] == 0)
		{
			AddStaticPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],-1);
			pickups++;
			format(bstr, sizeof(bstr), "{FF0000}Adresa: {60FF38}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi", HouseInfo[h][hDiscription]);
			Create3DTextLabel(bstr,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0, 0, 1);
			//CreateDynamicMapIcon(HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez],31,0);
		}
		if(HouseInfo[h][hOwned] == 1)
		{
			AddStaticPickup(19522, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],-1);
			pickups++;
			format(bstr, sizeof(bstr), "{FF0000}Adresa: {60FF38}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi", HouseInfo[h][hDiscription]);
			Create3DTextLabel(bstr,0x9EC73DFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0, 0, 1);
			//CreateDynamicMapIcon(HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez],32,0);
		}
	}
	for(new h = 0; h < sizeof(BizzInfo); h++)
	{
	    new adresa[255];
		if(BizzInfo[h][bOwned] == 0)
		{
			AddStaticPickup(1272, 1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ],-1);
			pickups++;
			format(adresa, sizeof(adresa), "{3366FF}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi",BizzInfo[h][bMessage]);
			Create3DTextLabel(adresa,0x00CCFFFF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1.0,30.0, 0, 1);
		}
		if(BizzInfo[h][bOwned] == 1)
		{
			AddStaticPickup(19522, 1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ],-1);
			pickups++;
			format(adresa, sizeof(adresa), "{3366FF}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi",BizzInfo[h][bMessage]);
			Create3DTextLabel(adresa,0x00CCFFFF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1.0,30.0, 0, 1);
		}
	}
	for(new h = 0; h < sizeof(SBizzInfo); h++)
	{
	    new adresa[255];
		if(SBizzInfo[h][sbOwned] == 0)
		{
			AddStaticPickup(1272, 1, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ],-1);
			pickups++;
			format(adresa, sizeof(adresa), "{3366FF}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi",SBizzInfo[h][sbMessage]);
			Create3DTextLabel(adresa,0x00CCFFFF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1.0,30.0, 0, 1);
		}
		if(SBizzInfo[h][sbOwned] == 1)
		{
			AddStaticPickup(19522, 1, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ],-1);
			pickups++;
			format(adresa, sizeof(adresa), "{3366FF}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi",SBizzInfo[h][sbMessage]);
			Create3DTextLabel(adresa,0x00CCFFFF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1.0,30.0, 0, 1);
		}
	}


Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da.

Ce pot face?

Edited by Bogdan's
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Trebuie să folosești CreatePickup / CreateDynamicPickup(dacă ai plugin-ul Streamer al lui Incognito), și atribui fiecărui pickup al unei case/bizz un ID, gen:

HouseInfo[h][hPickupID] = CreatePickup(....);

Vezi să creezi și în enum-ul cu variabilele caselor hPickupID. După care te joci cu el, îl distrugi când cumpără/vinde casa și îl recreezi.

Sper că ai înțeles, dacă mai ai nevoie de ceva, postează aici.

Link to comment
Share on other sites

  • 0

Nu n-am inteles,deci Exemplu aici:
 

if(HouseInfo[h][hOwned] == 0)
		{
			HouseInfo[h] = CreatePickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],-1);
			pickups++;
			format(bstr, sizeof(bstr), "{FF0000}Adresa: {60FF38}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi", HouseInfo[h][hDiscription]);
			Create3DTextLabel(bstr,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0, 0, 1);
			//CreateDynamicMapIcon(HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez],31,0);
		}

Asa?
 

Edited by Bogdan's
Link to comment
Share on other sites

  • 0

Deci, ar fi ceva de genul

 

if(HouseInfo[h][hOwned] == 0)
		{
			HouseInfo[h][hPickupID] = CreatePickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],-1);
			pickups++;
			format(bstr, sizeof(bstr), "{FF0000}Adresa: {60FF38}%s \n {FFFFFF}Apasati {2CFC33} ENTER {FFFFFF}pentru a \n intra/iesi", HouseInfo[h][hDiscription]);
			Create3DTextLabel(bstr,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1.0,30.0, 0, 1);
			//CreateDynamicMapIcon(HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez],31,0);
		}

Tu trebuie sa atribui un ID acelui pickup creat, si atunci cand cineva cumpara casa folosesti DestroyPickup ca sa il distrugi, si dupa il recreezi.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.