• 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!

[REQUEST - 5 USD PAYMENT] Frag Reward

Michael Orsino

Premium User
Premium User
Support Team
Joined
Nov 15, 2007
Messages
854
Solutions
10
Reaction score
389
Location
Santiago, Chile (Australian)
I need a script that when a player dies, his killers receive 100gp. This script MUST be compatible with CD0.3.5pl1.

E.g. 3 mages kill a knight. The three mages should receive 100gp immediately. A reward for their frag.

Release it to the public and post/pm me an email address linked to your paypal account and I will transfer the reward immediately.

Thank you,
Michael
 
Not tested.

creaturescripts/scripts/fragreward.lua
Code:
function onKill(cid, target)
        if isPlayer(target) == TRUE then  
        loot = 2152 
	item = doPlayerAddItem(cid,loot,1)     
        end
        return TRUE
end

creaturescripts.xml
Code:
<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>

And finally, in your onLogin:
Code:
registerCreatureEvent(cid, "FragReward")
 
Works, thanks a lot.
Paying now =)

Please confirm the payment on this thread so that in future people can see that I am legit.

Cheers,
Michael

Edit: Michael, you have sent $5.00 USD to Star Electronix.
 
I do script myself, I do almost everything myself.
I was having specific trouble with this particular script, as it turns out I was going about it the complete wrong way. I was scripting from OnDeath instead of OnKill, which makes much more sense.

I wanted the script quickly so I offered a reward, I have no doubt that I could have made the script myself eventually, and I have no doubt that I could have had it written for free. The reward was for the speed.

Anyhoo, hardly your business anyway.
 
Thanks for the $5, glad I could help. =) I would have done it for free also but I never pass on a quick dollar!

Yeah, he shortened the script by one line, but that's how I like to code anyway. In my opinion looks more clean.
 
@UP:
Code:
function onKill(cid, target)
	if (isPlayer(cid) and isPlayer(target)) then
		doPlayerAddItem(cid, 2152, 1)
	end
	return true
end
 
@Chojrak, onKill won't executing for creatures, so cid cannot be not player...ops you're right, if cid player died, and target dying by condition... yeah
@Thuggeh, Marencian, it was not fine, because there were
loot = 2152
item = doPlayerAddItem(cid,loot,1)
2 not necessary declarations, and they don't even local :)

No offense, i just made a small fix, don't pretending for anything ;d
 
two declarations that are good practice to be using as when writing larger and more complex scripts they become insanely helpful.
I understand that you have 'optimized' the script, there just happens to be no point.
Anyway, Thanks to all

-Michael
 
Back
Top