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

PK Points!

keccish

New Member
Joined
Sep 16, 2010
Messages
33
Reaction score
1
I was looking for a system to get Point's by killing players. Amlost like the, Donation Points but this would cost much more than usuall donates will cost.


Basicly what im looking for a diffrent kind of Donate system, but instead of donating u kill players, and get like 1 Kill Point each.

And later on after killing like 100+ players you could buy one Donate!


Getting a point you need to kill atleast a level 300+


I dont know if it's possible but if it would it'll bee awesome! If there already is a thread for this please link it :$
 
creaturescripts/creaturescripts.xml, add:
XML:
	<event type="kill" name="KillPoint" event="script" value="killpoint.lua"/>

creaturescripts/scripts/killpoint.lua:
Lua:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
		if getPlayerIp(cid) == getPlayerIp(target) then		
			doCreatureAddHealth(cid, - getCreatureMaxHealth(cid))
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
		else
			db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + 1 WHERE `accounts`.`id` = ".. getAccountIdByName(cid) .." LIMIT 1;")
		end
	end
	return true
end


This will add one premium point every time you kill someone. If you kill someone with the same ip address then you should get slayed.
 
This will add one premium point every time you kill someone. If you kill someone with the same ip address then you should get slayed.

Thanks, but I am looking something more only getting the kill points not donate ones, and then on the web you can choose to buy from donate points or kill points to buy the stuff.:$

- - - Updated - - -

Bump
 
Something Like this?

query
Lua:
ALTER TABLE `players` ADD `points` INT ( 32 ) NOT NULL DEFAULT 0;

onkill
Lua:
function onKill(cid, target, lastHit)

			if(lastHit == true) then
		      doPlayerAddPoints(cid, 1)
	end
	return true
end

lib
Lua:
function getPlayerPoints(cid)
	local DB_points = db.getResult("SELECT `points` FROM `players` WHERE `name` = '"..getCreatureName(cid).."';")
	points = DB_points:getDataInt("points")
	DB_points:free()
	return points
end

function doPlayerAddPoints(cid, add)
	return db.executeQuery("UPDATE `players` SET `points` = `points` + "..add.." WHERE `name` = '"..getCreatureName(cid).."';")
end
 
function doPlayerRemovePoints(cid, count)
        return db.executeQuery("UPDATE `players` SET `points` = '".. getPlayerPoints(cid) - count .."' WHERE `name` ='"..getCreatureName(cid).."'")
end

Points Player won't Premium Points On Account
 
Last edited:
Back
Top