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

Skull System 0.4

Scorpvm

Member
Joined
Feb 23, 2010
Messages
434
Solutions
3
Reaction score
16
Location
Spain
Hi dears.
Anyone know how i fix me problem?
I need,
If some player get X frags then receive some type of skull:
Green Skull - 50 kills,
White Skull - 100 kills,
Yellow Skull - 200 kills,
Red Skull - 400 kills,
Black Skull -500 kills.

I know I have to edit the source

i have remove this from player.cpp:

Code:
 if((player == this || (skull != SKULL_NONE && player->getSkull() < SKULL_RED)) && player->hasAttacked(this))
			return SKULL_YELLOW;

and remove this:

Code:
if(skull == SKULL_NONE)
	{
		if(targetPlayer->getSkull() != SKULL_NONE)
			targetPlayer->sendCreatureSkull(this);
		else if(!hasCustomFlag(PlayerCustomFlag_NotGainSkull))
		{
			setSkull(SKULL_WHITE);
			g_game.updateCreatureSkull(this);
		}
	}
and add it in CREATURESCRIPTS :

Code:
local storage = 9000
 
function onKill(cid, target, lastHit)
	if isPlayer(target) and cid ~= target then
		local frags = math.max(0, getCreatureStorage(cid, storage)) + 1
		setPlayerStorageValue(cid, storage, frags)
		if frags >= 50 then
			doCreatureSetSkullType(cid, SKULL_GREEN)
		elseif frags >= 100 then
			doCreatureSetSkullType(cid, SKULL_WHITE)
		elseif frags >= 200 then
			doCreatureSetSkullType(cid, SKULL_YELLOW)
		elseif frags >= 400 then
			doCreatureSetSkullType(cid, SKULL_RED)
		elseif frags >= 500 then
			doCreatureSetSkullType(cid, SKULL_BLACK)
		end
	end
	return true
end

But my problem is that:
When player get 1 frag he get green skull and then he dont receives more skull

Sorry my bad english
 
Last edited:
Lua:
local storage = 9000
 
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
		local a = math.max(0, getCreatureStorage(cid, storage)) + 1
		doCreatureSetStorage(cid, storage, a)
		if a == 50 then
			doCreatureSetSkullType(cid, SKULL_GREEN)
		elseif a == 100 then
			doCreatureSetSkullType(cid, SKULL_WHITE)
		elseif a == 200 then
			doCreatureSetSkullType(cid, SKULL_YELLOW)
		elseif a == 400 then
			doCreatureSetSkullType(cid, SKULL_RED)
		elseif a == 500 then
			doCreatureSetSkullType(cid, SKULL_BLACK)
		end
	end
	return true
end
 
Waw, it works! REP+++!
Now as I can do if X player die with red or black skull dont lost items? And if X player is black dont receive damage x2.
 
Thx guy!
Now i have the last question..
If any player get 30 frags.. and when he logout how i make he lost all frags?

Sorry me english :/
 
Back
Top