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

Lua fragrewards.lua

verenko

New Member
Joined
Mar 16, 2011
Messages
22
Reaction score
1
Location
Poland
Hello. I'm new on this forum but i enjoyed it. I think u can help me cuz there are many good scripters :)

I'v got problem with my NoobWar server.

When i do fire fields and die on them server gives me item. Pls solve this bug! ;D

fragrewards.lua

Lua:
function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1
}
    for i = 1, #deathList do
        if isPlayer(cid) and isPlayer(deathList[i]) then
            if getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then
                if getPlayerItemCount(deathList[i], reward.item) > 0 then
                    local item = getPlayerItemById(deathList[i], true, reward.item)
                    if item.type >= ITEMCOUNT_MAX then
                        doPlayerAddItem(deathList[i], reward.item, reward.count)
                        doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                        doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                    else
                        doTransformItem(item.uid, reward.item, item.type + 1)
                        doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                        doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                    end
                else
                    doPlayerAddItem(deathList[i], reward.item, reward.count)
                    doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                    doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                end
            else
                doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
            end
    return true
end

Also check my skull.lua When i die on fire field server doesn't count frag but maybe its wrong anyway.

skulls.lua

Lua:
local storage = 20233
local reward = {
        item = 11197,
        count = 1
}
function onKill(cid, target, flags, damage)
    if isPlayer(target) then
        if getPlayerIp(cid) ~= getPlayerIp(target) then
                local frags = math.max(0, getPlayerStorageValue(cid, storage))
                doCreatureSetStorage(cid, storage, frags+1)
                if(frags >= 5000) then
                    doCreatureSetGuildEmblem(cid, EMBLEM_RED)
                elseif(frags >= 1500) then
                    doCreatureSetGuildEmblem(cid, EMBLEM_BLUE)
                elseif(frags >= 250) then
                    doCreatureSetGuildEmblem(cid, EMBLEM_GREEN)
                end
        end        
                
                if getPlayerItemCount(cid, reward.item) > 0 then
                    local item = getPlayerItemById(cid, true, reward.item)
                    if item.type >= 100 then
                        doPlayerAddItem(cid, reward.item, reward.count)
                    else
                        doTransformItem(item.uid, reward.item, item.type + 1)
                    end
                else
                    doPlayerAddItem(cid, reward.item, reward.count)
                end
                doSendAnimatedText(getPlayerPosition(cid), "Frag!", TEXTCOLOR_RED)
        else
            doPlayerSendTextMessage(cid, 18, "You didn't get frag/reward because of killing a player with same ip.")
        end
    return true
end

BUT WHERE ARE MY SKULLS ;D? I SEE ONLY GUILD EMBLEMS. If you want i can give you IP and u can test it. I'll be online on 9 PM (polish time)

ALSO I GOT ERROR : Invalid password
Ok i created acc, now i login on it and choose account manager and this error appears. I use sha1 enc.
 
Last edited by a moderator:
For first problem try change:
Lua:
 if isPlayer(cid) and isPlayer(deathList[i]) then
for
Lua:
 if isPlayer(cid) and isPlayer(deathList[i])  and getCreatureName(cid) ~= getCreatureName(deathList[i]) then
 
R++ for try but it didn't help me :(

Now my fragrewards.lua looks :
Lua:
function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1
}
    for i = 1, #deathList do
        if isPlayer(cid) and isPlayer(deathList[i]) and getCreatureName(cid) ~= getCreatureName(deathList[i]) then
            if getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then
                if getPlayerItemCount(deathList[i], reward.item) > 0 then
                    local item = getPlayerItemById(deathList[i], true, reward.item)
                    if item.type >= ITEMCOUNT_MAX then
                        doPlayerAddItem(deathList[i], reward.item, reward.count)
                        doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                        doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                    else
                        doTransformItem(item.uid, reward.item, item.type + 1)
                        doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                        doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                    end
                else
                    doPlayerAddItem(deathList[i], reward.item, reward.count)
                    doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                    doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                end
            else
                doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
            end
    return true
end

Or it should look like :

Lua:
function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1
}
    for i = 1, #deathList do
        if isPlayer(cid) and isPlayer(deathList[i]) and getCreatureName(cid) ~= getCreatureName(deathList[i]) then
                if getPlayerItemCount(deathList[i], reward.item) > 0 then
                    local item = getPlayerItemById(deathList[i], true, reward.item)
                    if item.type >= ITEMCOUNT_MAX then
                        doPlayerAddItem(deathList[i], reward.item, reward.count)
                        doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                        doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                    else
                        doTransformItem(item.uid, reward.item, item.type + 1)
                        doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                        doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                    end
                else
                    doPlayerAddItem(deathList[i], reward.item, reward.count)
                    doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                    doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                end
            else
                doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
            end
    return true
end

When I am on God account and I summon demon and I kill kim in default i see:

10:09 You didn't get frag/reward because of killing a player with same ip. ....

This also appears when i kill DL Summon - Fire Elemental
 
Last edited by a moderator:
I don't understand you, but this item is very important because it's noobwar.

Now my fragreward.lua looks original:

Code:
function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1
}
	for i = 1, #deathList do
		if isPlayer(cid) and isPlayer(deathList[i]) then
			--[[if getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then	]]--	
				if getPlayerItemCount(deathList[i], reward.item) > 0 then
					local item = getPlayerItemById(deathList[i], true, reward.item)
					if item.type >= ITEMCOUNT_MAX then
						doPlayerAddItem(deathList[i], reward.item, reward.count)
						doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
						doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
					else
						doTransformItem(item.uid, reward.item, item.type + 1)
						doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
						doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
					end
				else
					doPlayerAddItem(deathList[i], reward.item, reward.count)
					doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
					doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
				end
			--[[else
				doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
				
			end ]]--
		end
	end
	return true
end
 
Last edited:
Try this instead. Btw, found it in my old server. Not created by me.

Code:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then
			doCreatureAddHealth(cid, -200)
			doCreatureAddMana(cid, -200)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
		else
			doPlayerAddItem(cid, 2160, 1)
			setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
		end
	end
 
	if(getPlayerStorageValue(cid, 6776) == 5) and getCreatureStorage(cid, 6001) == -1 then
		broadcastMessage(getCreatureName(cid) .. " is on killing spree! He killed 5 players!")
		setPlayerStorageValue(cid, 6001, 1)
		doCreatureSetSkullType(cid, 3) -- 3 is white
 
	elseif(getPlayerStorageValue(cid, 6776) == 10) and getCreatureStorage(cid, 6002) == -1 then
		broadcastMessage(getCreatureName(cid) .. " is dominating! He killed 10 players!")
		setPlayerStorageValue(cid, 6002, 1)
		doCreatureSetSkullType(cid, 4) -- 3 is red
 
	elseif(getPlayerStorageValue(cid, 6776) == 25) and getCreatureStorage(cid, 6003) == -1 then
		broadcastMessage(getCreatureName(cid) .. " is CRAZY! He killed 25 players!")
		setPlayerStorageValue(cid, 6003, 1)
		doCreatureSetSkullType(cid, 5) -- 5 is black
 
	elseif(getPlayerStorageValue(cid, 6776) == 50) and getCreatureStorage(cid, 6004) == -1 then
		broadcastMessage(getCreatureName(cid) .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
		setPlayerStorageValue(cid, 6004, 1)
		doPlayerAddItem(cid, 2640, 1) -- soft boots as reward for killing 50 players
 
	elseif(getPlayerStorageValue(cid, 6776) == 100) and getCreatureStorage(cid, 6005) == -1 then
		broadcastMessage("Bow down to your new god! " ..getCreatureName(cid).. " has 100 frags!")
		setPlayerStorageValue(cid, 6005, 1)
		doPlayerAddItem(cid, 8266, 1) -- kosheis amulet as reward for killing 100 players
 
	elseif(getPlayerStorageValue(cid, 6776) == 150) and getCreatureStorage(cid, 6006) == -1 then
		broadcastMessage(getCreatureName(cid) .. " is not a human! He killed 150 players!")
		setPlayerStorageValue(cid, 6006, 1)
		doPlayerAddItem(cid, 9932, 1) -- firewalker boots as reward for killing 150 players
	return true
end
end
 
Thx for help it is also useful, but can u add this "Frag!", TEXTCOLOR_RED) to your script. And this is very important, U know it's noobwar serv with Evul Eye when u kill some1. 100 eyes= 25 eggs. 1 egg= exprience. Pls just these 2 things ;)
Code:
 function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1

if you want, enter my server and check this:

ip: 78.88.33.226
8.6
 
Thx for help it is also useful, but can u add this "Frag!", TEXTCOLOR_RED) to your script. And this is very important, U know it's noobwar serv with Evul Eye when u kill some1. 100 eyes= 25 eggs. 1 egg= exprience. Pls just these 2 things ;)
Code:
 function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1

if you want, enter my server and check this:

ip: 78.88.33.226
8.6

Message me in-game.
 
Ok. Any ideas how to make not reward for myself when i die on fire field?

Code:
function onDeath(cid, corpse, deathList)
local reward = {
        item = 11197,
        count = 1
}
	for i = 1, #deathList do
		if isPlayer(cid) and isPlayer(deathList[i]) then
			--[[if getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then	]]--	
				if getPlayerItemCount(deathList[i], reward.item) > 0 then
					local item = getPlayerItemById(deathList[i], true, reward.item)
					if item.type >= ITEMCOUNT_MAX then
						doPlayerAddItem(deathList[i], reward.item, reward.count)
						doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
						doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
					else
						doTransformItem(item.uid, reward.item, item.type + 1)
						doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
						doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
					end
				else
					doPlayerAddItem(deathList[i], reward.item, reward.count)
					doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
					doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
				end
			--[[else
				doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
				
			end ]]--
		end
	end
	return true
end
 
Back
Top