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

CreatureEvent 0.3.6 - 0.4 - onKill - Frag Reward + Ip check + Level Threshold

Codex NG

Recurrent Flamer
Joined
Jul 24, 2015
Messages
2,994
Solutions
12
Reaction score
1,657
Code:
local level = 10
function onKill(cid, target, lastHit)
    if (isPlayer(cid) and isPlayer(target)) then
        if (getPlayerLevel(cid) + level) < getPlayerLevel(target) then
            if getPlayerIp(cid) ~= getPlayerIp(target) then
                local create = doPlayerAddItem(cid, 7369, 1)
                doItemSetAttribute(create, 'description', "Trofeo por matar a "..getPlayerName(target).." en level "..getPlayerLevel(target).." cuando tu eras level "..getPlayerLevel(cid)..".")
                doPlayerSendTextMessage(cid, 24, "Te ganaste un trofeo por matar un player con lvl más alto que el tuyo.")
            end
        end
    end
    return true
end
 
Code:
                doItemSetAttribute(create, 'description', "Trofeo por matar a "..getPlayerName(target).." en level "..getPlayerLevel(target).." cuando tu eras level "..getPlayerLevel(cid)..".")
                doPlayerSendTextMessage(cid, 24, "Te ganaste un trofeo por matar un player con lvl más alto que el tuyo.")

Dat language :p
Anyways nice share, just read in a thread few mins ago that a guy would need something like that :p
At least the ip part...guess it was noob war advertise thread.. w/e
GJ
 
this still can be abused, if the player who gets attacked x-logs his ip will change to 0, so the ip check wont prevent that.
either get ip from database, or throw the ip in a table on login to check if it matches.
 
this still can be abused, if the player who gets attacked x-logs his ip will change to 0, so the ip check wont prevent that.
either get ip from database, or throw the ip in a table on login to check if it matches.
It can also be "abused" if the second player is intentionally allowing the other to kill him only to receive the reward
 
Last edited:
this still can be abused, if the player who gets attacked x-logs his ip will change to 0, so the ip check wont prevent that.
either get ip from database, or throw the ip in a table on login to check if it matches.
Code:
if getPlayerIp(cid) ~= getPlayerIp(target) then
if getPlayerIp(cid) ~= 0 then 
if getPlayerIp(target) ~= 0 then
 
It can also be "abused" if the second player is intentionally allowing the other to kill him only to receive the reward
Well other than a storage value to prevent the abuse of farming items.. you can't really do much more as a preventive measure..
Its a basic script, I am not building their server for them :p
 
Code:
if getPlayerIp(cid) ~= getPlayerIp(target) then
if getPlayerIp(cid) ~= 0 then
if getPlayerIp(target) ~= 0 then
I didn't mention that for a certain reason, if the victim knows that he's going to die anyway and wants to deny the reward for the attacker then he could just x-log, so that's not really a good solution either.
 
I didn't mention that for a certain reason, if the victim knows that he's going to die anyway and wants to deny the reward for the attacker then he could just x-log, so that's not really a good solution either.
We'll I am kind of tired for some odd reason.. feeling sluggish :(
Give it a go and see what you come up with.
 
Well other than a storage value to prevent the abuse of farming items.. you can't really do much more as a preventive measure..
Its a basic script, I am not building their server for them :p
yeah you're right, i was just stating the obvious >_<
 
1) check the database for the last ip (player table 'lastip')
2) throw all ips on login in a table and match it through there.

I'm not really happy with any of those solutions but unless you modify the sources, I'm pretty certain that there is no other way
 
Back
Top