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

drax skylon

o.O DrAx O.o
Joined
Sep 9, 2008
Messages
225
Reaction score
3
Hello
since yesterday I was working in this script but I don't know why this isn't working :p

Code:
function onSay(cid, words, param)

local config =
{
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT),
	cost = 100000,
	pname = getPlayerGUID(cid)
}

	if config.playerIsFighting == FALSE then
		if(doPlayerRemoveMoney(cid, config.cost) == TRUE) then
			doCreatureSetSkullType(cid, SKULL_NONE)
			db.executeQuery("UPDATE `players` SET `skulltime` = '0' WHERE `id` = " .. config.pname .. " LIMIT 1;")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
			doRemoveCreature(cid)
		else
			doPlayerSendCancel(cid, "You do not have enough money. To remove your frags you have to pay 100000 gold coins.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, you can not remove your frags during a fight.")
	end
	return TRUE
end

PS: When I changed "skulltime" to "0" manually in my database the character still do not lose his frags :blink:

Please help me! :D
 
Try adding this:
Code:
db.executeQuery("DELETE FROM `player_killers` WHERE `player_id` = " .. config.pname .. ";")
were did you get this from?? :)
shouldn't it be playerpz or something like that? ;)
Code:
local config =
{
	[B][COLOR="Red"]playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)[/COLOR][/B],
 

Similar threads

Back
Top