A small problem...
#3

How to subtract that?
I think it is there because it takes the money away :P But I aint sure tbh. This is what it is...

Код:
dcmd_buy(playerid,params[])
{
  #pragma unused params
	new str[255],str1[255],pname[24], housenumber;
	housenumber = GetHouseID(playerid);
	if(housenumber == -1) return SendClientMessage(playerid, COLOR_ADMIN, "*** Nie jestes w ikonce domu!");

	GetPlayerName(playerid, pname, 24);
	format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
	if(dini_Exists(str1))
	{
		if (dini_Int(str1, "Houseid")!=-255) return SendClientMessage(playerid, COLOR_YELLOW, "*** Możesz kupić tylko jeden dom!");
	}
	format(str1, sizeof(str1), "Houses/houseid%d", housenumber);
	if (strcmp(hInfo[housenumber][Name],"ForSale",true)) return SendClientMessage(playerid, COLOR_YELLOW, "*** Ten dom nie jest na sprzedaż!");
	if(GetPlayerMoney(playerid)<hInfo[housenumber][Cost]) return SendClientMessage(playerid, COLOR_ADMIN, "*** Nie masz wystarczająco pieniędzy przy sobie!");
	SendClientMessage(playerid, COLOR_GREEN, "*** Gratulacje, własnie stałes się włascicielem tej parceli! Wpisz /househelp aby zobaczyć komendy własciciela domu!");
	format(str, sizeof(str), "%s has bought houseid 0",pname);
	print(str);
	GivePlayerMoney(playerid, -hInfo[housenumber][Cost]);
  dini_Set(str1, "Name", pname);
  hInfo[housenumber][Name]=pname;
  hInfo[housenumber][Locked] = dini_IntSet(str1,"Locked",0);

	format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
	if (!dini_Exists(str1)) dini_Create(str1);
	new Float:sy, Float:sx, Float:sz;
	dini_IntSet(str1, "Houseid", housenumber);
	if(!dini_Isset(str1,"Rentid"))
	{
		dini_IntSet(str1, "Rentid", -255);
	}
	GetPlayerPos(playerid, sx,sy,sz);
	dini_FloatSet(str1, "SpawnX", sx);
	dini_FloatSet(str1, "SpawnY", sy);
	dini_FloatSet(str1, "SpawnZ", sz);
	dini_IntSet(str1, "SpawnInt", GetPlayerInterior(playerid));
	DestroyPickup(HousePickup[housenumber]);
	HousePickup[housenumber] = CreatePickup(1272, 23, hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz]);
	return 1;
}
That would be the subtraction If i am not mistaken:
Код:
	GivePlayerMoney(playerid, -hInfo[housenumber][Cost]);
  dini_Set(str1, "Name", pname);
Reply


Messages In This Thread
A small problem... - by Puzi - 06.01.2010, 08:48
Re: A small problem... - by Deat_Itself - 06.01.2010, 08:56
Re: A small problem... - by Puzi - 06.01.2010, 09:21
Re: A small problem... - by Puzi - 06.01.2010, 09:44
Re: A small problem... - by Deat_Itself - 06.01.2010, 10:05
Re: A small problem... - by Puzi - 06.01.2010, 10:14
Re: A small problem... - by Deat_Itself - 06.01.2010, 10:16
Re: A small problem... - by Puzi - 06.01.2010, 10:38
Re: A small problem... - by Deat_Itself - 06.01.2010, 10:42
Re: A small problem... - by Puzi - 06.01.2010, 10:50

Forum Jump:


Users browsing this thread: 2 Guest(s)