• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

If too much money then many problems :/

wesoly136

Member
Joined
Jul 30, 2009
Messages
562
Reaction score
9
Hi!
I made on my OT a z coin(100cc) and y coin(100 z coins). And when I have about 120 y coins and want to buy aol via talkaction it says me "You don't have enough money", but when I have 100 y coins it sells me one aol, second aol, and when I have 99 y coins
And buy !aol for 50 z coins(0.5 y coin) It takes me a strange amount of money like 7608760 and from 99 y coins I have 13~ :/ Any ideas?
 
game.cpp
Code:
uint[B][COLOR="Red"]32[/COLOR][/B]_t Game::getMoney(const Cylinder* cylinder)
{
	if(!cylinder)
		return 0;

	std::list<Container*> listContainer;
	Container* tmpContainer = NULL;

	Thing* thing = NULL;
	Item* item = NULL;

	[B][COLOR="Red"]uint32_t[/COLOR][/B] moneyCount = 0;
game.h
Code:
		uint[B][COLOR="Red"]32[/COLOR][/B]_t getMoney(const Cylinder* cylinder);
Change 32 to 64? :p

It should raise the limit from 4294967296 to 18446744073709551616.
Well, at least theoretically.
 
Last edited:
uhh, I don't think it can be fixed even with source edits, if 64 didn't work then its probably impossible. Why don't you just do something like

Code:
function onSay(cid, words, param, channel)
	if(isPlayer(cid) and getPlayerItemCount(cid, ITEM_ID) >= 50) then
		doPlayerRemoveItem(cid, ITEM_ID, 50)
		doPlayerAddItem(cid, ITEM_ID, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've bought an amulet of loss!")
	else
		doPlayerSendCancel(cid, "Not enough money.")
		end
	return true
end

just an example, probably has errors.. didn't look through it
 
I now what you mean - to use 'get' for my money as an item not money, but what with npc? :S
I thought about creaturescript onThink that when player has more then xx new coins it will be send to his depot :P

EDIT
I'm not sure if I compiled server right, but I made frags time together with that and frags are working so compiling was right... :/
Sorry for English
 
Well, you can always make NPC's the same way right? Except it won't be able to support the trade window.. just do something like "hi, aol, yes", other then that im out of ideas
 
Back
Top