Guitar Freak
_LüA_n☺b_
Well as the title says Im having some requests that are probably very simple to some of you guys but I just cant finish getting them correctly and it pisses me off cause Im losing so much time, so its time to ask for a bit of help here.
Any suggestions appreciated, Ill tell you if Ive done them already or not.
Needless to say, I will +REP everyone who HELPS me on any of the issues.
Not random posters, but the helpful ones.
Thanks in advance.
Cheers.
- Probably the most simple one, I need a talkaction called "!checkbless" that costs money to cast and it will show a message (preferably non-popup but not neccesary, Ill change that) saying:
"You have successfully paid " .. amountofmoney .. " for your blessings check. Right now you have: first bless, second bless" etc. Or "You dont have any blessings." if none. [This one is solved]
- Second one, I have a talkaction called !buyhp (and !buymana) that works fine, with it you can buy amounts of HP or Mana for a price permanently, but the problem is that I also want to have an NPC that does the same thing, sell HP/Mana but I cant make it work properly and I dont even know what Im doing there.
Here is the script for the !buyhp talkaction, which is mixed to the !buymana one, it is 1 script for both (credits are not entirely mine, but you can use it for your server if you desire):
buyhpmana.lua:
PHP:local config = { healthCost = 20000, healthAmount = 100, manaCost = 20000, manaAmount = 100 } function onSay(cid, words, param) local fSet, fGet, fAdd = setCreatureMaxHealth, getCreatureMaxHealth, doCreatureAddHealth local cost, amount = config.healthCost, config.healthAmount local str = "health" if(words == "!buymana") then fSet, fGet, fAdd = setCreatureMaxMana, getCreatureMaxMana, doCreatureAddMana cost, amount = config.manaCost, config.healthAmount str = "mana" end if(doPlayerRemoveMoney(cid, cost) ~= TRUE) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you dont have enough money. It costs 20k each 100 HP or Mana.") return TRUE end fSet(cid, fGet(cid) + amount) fAdd(cid, amount) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. amount .. " " .. str .. " points.") return TRUE end
Anyone knows how to transpose that to an NPC?
- Third and I think this one is a bit more complicated, something about money currencies.
Right now I have 2 custom currencies going on in my server, they all work perfectly, you can correctly convert 100 cc to 1 of the 1st currency (lets call it X) and 100 X to 1 of 2nd currency (call it Y), you can buy stuff with any currency correctly, so NPCs recognize them as money and also talkactions do.
The value table would be:
100 gold > 1 platinum
100 platinum > 1 crystal
100 crystal > 1 X
100 X > 1 Y
The problem comes when you buy something cheap with lets say 1 Y, the NPCs dont recognize the custom currencies as "change", so if I buy something worth 10k with a coin thats worth 100 million, the change the NPC gives me back is all in CRYSTAL COINS (and plats, gold), so I get like 1000 packs of CCs in the bp + floor therefore I debug.
I cant get my head around of why this happens, because if the NPCs recognize the currencies as money to buy stuff, why wont they give me the change in those currencies? Same with talkactions.
This 3rd one is the most urgent one, but I think it is more complicated too. But I dont know, it might be something stupid Im missing.
I dont think this is a problem of the scripts, but if you need all the scripts that relate to my currencies I can post them, just tell me.
Any suggestions appreciated, Ill tell you if Ive done them already or not.
Needless to say, I will +REP everyone who HELPS me on any of the issues.
Not random posters, but the helpful ones.
Thanks in advance.
Cheers.
Last edited: