Jump to content

Question

Posted

Salut, am descarcat gm-ul b-hood postat de @HPQ123  si am o problema la comanda /buyhouse.

Nu returneaza absolut nimic cand o scrii. Nici un fel de eroare, absolut nimic, e ca si cum comanda n-ar exista, acelasi lucru pentru /buybiz, dar nu stiu de ce. Ma puteti ajuta?

Ma invart de 3 zile la bugul asta deci m-as bucura daca l-as rezolva cu ajutorul vostru. Am mai vorbit cu un coleg care are acelasi gm si la el nu este problema asta. Sa fie oare de la baza de date?

Baza de date a fost inclusa in arhiva gm-ului.

Host-ul este de la gazduirejocuri, pluginurile ar trebui sa fie updatate. In rest nu mai am nici o problema cu gm-ul.

Multumesc anticipat!

Discord: L2P Daemon#8635

 

YCMD:buyhouse(playerid, params[], help) {
	new id, string[180];
	for(new h = 1; h <= housess; h++) {
		if(PlayerToPoint(2, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez])) {
			if(HouseInfo[h][hValue] == 0) return true;
			if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel]) {
				format(string, sizeof(string), "Ai nevoie de nivel %d pentru a cumpara.", HouseInfo[h][hLevel]);
				SCM(playerid, COLOR_WHITE, string);
				return true;
			}
			if(PlayerInfo[playerid][pHouse] != 999 && strcmp(GetName(playerid), HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], true) == 0) return SCM(playerid, COLOR_WHITE, "Ai deja o casa.");
			if(PlayerMoney(playerid, HouseInfo[h][hValue])) return SCM(playerid, COLOR_GREY, "Nu ai destui bani pentru a cumpara aceasta casa.");
			id = GetPlayerID(HouseInfo[h][hOwner]);
			gQuery[0] = EOS;
			if(id != INVALID_PLAYER_ID) {
				PlayerInfo[id][pHouse] = 999;
				Update(id, pHousex);
				GivePlayerBank(id, HouseInfo[h][hValue]);
				Update(id, pBankx);
				Update(id, pMBankx);
				format(string, sizeof(string), "* %s ti-a cumparat casa pentru {19CF2E}$%s{239931}. Banii au fost transferati in contul tau bancar.", GetName(playerid), FormatNumber(HouseInfo[h][hValue]));
				SCM(id, 0x239931FF, string);
				mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE users SET `Bank`='%d', `MBank`='%d' WHERE `ID`='%d'",PlayerInfo[id][pAccount], PlayerInfo[id][pStoreAccount],PlayerInfo[id][pSQLID]);
				mysql_tquery(SQL, gQuery, "", "");
			} else {
				mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM `users` WHERE `name` = '%s'", HouseInfo[h][hOwner]);
				mysql_tquery(SQL, gQuery, "CheckUsers", "ii", 0, h);			
			}				
			InHouse[playerid] = h;
			PlayerInfo[playerid][pHouse] = HouseInfo[h][hID];
			UpdateVar(playerid, "House", PlayerInfo[playerid][pHouse]);
			UpdateVar(playerid, "Rented", -1);
			PlayerInfo[playerid][pRented] = -1;
			HouseInfo[h][hOwned] = 1;
			format(HouseInfo[h][hOwner], 256, GetName(playerid));
			GivePlayerCash(playerid, 0,HouseInfo[h][hValue]);
			SetPlayerInterior(playerid,HouseInfo[h][hInterior]);
			SetPlayerPosEx(false, playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
			SetPlayerVirtualWorld(playerid,HouseInfo[h][hVirtual]);
			PlayerInfo[playerid][pInt] = HouseInfo[h][hInterior];
			PlayerInfo[playerid][pLocal] = h;
			HouseInfo[h][hValue] = 0;
			SCM(playerid, COLOR_MONEY, "Felicitari! Ti-ai cumparat aceasta casa.");
			Update(playerid,pCashx);
			Update(playerid,pHousex);
			mysql_format(SQL,gQuery,sizeof(gQuery),"UPDATE `houses` SET `Owned`='1',`Owner`='%s',`Value`='0' WHERE `ID`='%d'", PlayerInfo[playerid][pUsername],HouseInfo[h][hID]);
			mysql_tquery(SQL,gQuery, "", "");
			UpdateLabel(1, h);
			finishAchievement(playerid, 3);	
		}
	}
	return true;
}
function CheckUsers(type, h) {
	new money, money2;
	gQuery[0] = EOS;
	if(cache_num_rows() != 0) {
		cache_get_field_content_int(0, "Bank", money);
		cache_get_field_content_int(0, "MBank", money2);
		Add64Bit(money2, money, HouseInfo[h][hValue]);
		switch(type) {
			case 0: mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Bank` = '%d', `MBank`='%d', `House` = '999' WHERE `name` = '%s'", money, money2, HouseInfo[h][hOwner]);
			case 1: mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Bank` = '%d', `MBank`='%d', `Bizz` = '255' WHERE `name` = '%s'", money, money2, BizzInfo[h][bOwner]);
		}
		mysql_tquery(SQL, gQuery, "", "");	
	}
	return true;
}

Si buybiz:

YCMD:buybiz(playerid, params[], help) {
	new id, string[256];
	if(PlayerInfo[playerid][pBizz] != 255) return SCM(playerid, COLOR_WHITE, "Ai deja un biz! Foloseste /sellbiztostate pentru a-l vinde.");
	for(new b = 1; b < sizeof(BizzInfo); b++) {
		if(PlayerToPoint(2, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bBuyPrice] != 0) {
			if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevel]) {
				format(string, sizeof(string), "Ai nevoie de nivel %d pentru a cumpara.",BizzInfo[b][bLevel]);
				SCM(playerid, COLOR_WHITE, string);
				return true;
			}
			if(PlayerMoney(playerid, BizzInfo[b][bBuyPrice])) return SCM(playerid, COLOR_GREY, "Nu ai destui bani pentru a face asta.");
			gQuery[0] = EOS;
			id = GetPlayerID(BizzInfo[b][bOwner]);
			if(id != INVALID_PLAYER_ID) {
				PlayerInfo[id][pBizz] = 255;
				Update(id, pBizzx);
				GivePlayerBank(id, BizzInfo[b][bBuyPrice]);
				Update(id, pBankx);
				Update(id, pMBankx);
				format(string, sizeof(string), "* %s ti-a cumparat afacerea pentru {19CF2E}$%s{239931}. Banii au fost transferati in contul tau bancar.", GetName(playerid), FormatNumber(BizzInfo[b][bBuyPrice]));
				SCM(id, 0x239931FF, string);
				mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE users SET `Bank`='%d', `MBank`='%d' WHERE `ID`='%d'",PlayerInfo[id][pAccount],PlayerInfo[id][pStoreAccount], PlayerInfo[id][pSQLID]);
				mysql_tquery(SQL, gQuery, "", "");					
			}
			else {
				mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM `users` WHERE `name` = '%s'", BizzInfo[b][bOwner]);
				mysql_tquery(SQL, gQuery, "CheckUsers", "ii", 1, b);
			}				
			PlayerInfo[playerid][pBizz] = b;
			BizzInfo[b][bOwned] = 1;
			format(BizzInfo[b][bOwner], 256, GetName(playerid));			
			GivePlayerCash(playerid, 0, BizzInfo[b][bBuyPrice]);
			BizzInfo[b][bBuyPrice] = 0;
			mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE users SET `Money`='%d',`Bizz`='%d' WHERE `ID`='%d'",MoneyMoney[playerid],PlayerInfo[playerid][pBizz],PlayerInfo[playerid][pSQLID]);
			mysql_tquery(SQL, gQuery, "", "");
			mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE `bizz` SET `Owned`='1',`Owner`='%s',`BuyPrice`='0' WHERE `ID`='%d'",BizzInfo[b][bOwner],b);
			mysql_tquery(SQL, gQuery, "", "");
			UpdateLabel(2,b);
			finishAchievement(playerid, 2);	
			SCM(playerid, COLOR_MONEY, "Felicitari! Ai cumparat aceasta afacere.");
		}
	}
	return true;
}

 

2 answers to this question

Recommended Posts

  • 0
Posted

sau daca il ai pe host, verifica server-log.txt si vezi daca e vreun [debug] in momentul cand ai dat /buyhouse.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.