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

TalkAction My suicide script.

R

Rozinx

Guest
When someone gets stuck, they always keep complaining and keeps asking everyone where the hell the gm is.
With this brand new tool, they'll be able to suicide and might stop setting you up.

So , first. I'll explain how it works.

When someone says the word suicide , they'll get a popup message, then when the person clicks ok , they'll have an storage value that makes it able to suicide.
You've gotta say suicide twice in order to suicide.
Here you are.


Make a suicide.lua script.

Lua:
function onSay(cid, words, param)
if
getPlayerStorageValue(cid,28999) == 1 and getPlayerLevel(cid) > 100 then
doCreatureAddHealth(cid,-10000000)
setPlayerStorageValue(cid,28999,0)

else 
doPlayerPopupFYI(cid, 'Do you really wanna suicide ?\n If you do\n Push ok and say suicide again.')
setPlayerStorageValue(cid,28999,1)

          end
end

Then put this on talkactions.xml
Lua:
<talkaction log="yes" words="suicide" event="script" value="suicide.lua"/>


See guys, on this part
getPlayerStorageValue(cid,28999) == 1 and getPlayerLevel(cid) > 100 then
The number 100 can be changed to any level you'd like to.
 
Last edited by a moderator:
Makes sense, I'll try to rewrite it in order to be only used if the player has no pz lock nor battle sign.
 
Well, but there would be another problem, if someone gets stuck at POI for example, and has no way out . . They'd probably be with battle on. So I guess I'll rewrite it for level 100+ players (assuming it's a low rate server, no level 100 in sane mind would kill himself for nothing) , but people can also change that number.
 
Not Tested - New Version

Lua:
local storage = 44551
function onSay(cid, words, param, channel)
local playerStorage = getPlayerStorageValue(cid)
local playerSkull = getCreatureSkullType(cid)
	if (words == 'suicide') then
		if(getTilePzInfo(getCreaturePosition(cid)) == true) then
			doPlayerSendCancel(cid, 'You cannot commit suicide in protection zone.')
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			return false
		end
		if(getCreatureCondition(cid, CONDITION_INFIGHT) == false) then
			if(playerSkull == SKULL_NONE) then
				doPlayerPopupFYI(cid, 'Think carefully about your decision. \n\nType: [suicide yes] \nType [suicide no] to decide.')
				setPlayerStorageValue(cid, storage, 1)
			else
				doPlayerSendCancel(cid, 'You are skulled, and you cannot kill yourself.')
			end
		else
			doPlayerSendCancel(cid, 'You are currently in a fight.')
		end
	elseif words == 'suicide yes' then
		if(playerStorage == 1) then
			doCreatureAddHealth(cid, -getCreatureHealth(cid))
			doCreatureAddMana(cid, -getCreatureMana(cid))
			doPlayerSendTextMessage(cid, 22, 'You have stupidly commited suicide.')
			setPlayerStorageValue(cid, storage, -1)
		else
			doPlayerSendCancel(cid, 'You must make your decision, say [suicide].')
		end
	elseif words == 'suicide no' then
		if(playerStorage == 1) then
			doPlayerSendTextMessage(cid, 22, 'You have overcome your suicidal thoughts, good luck!')
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
			setPlayerStorageValue(cid, storage, -1)
		else
			doPlayerSendCancel(cid, 'You must make your decision, say [suicide].')
		end
	end
	return true
end
 
Nice script man . . But as I was saying, I guess your script doesn't allow a battleticked guy to suicide . . Then the script would be useless, since it could be for stuck players
 
I made a simpler of your script too.
Lua:
function onSay(cid, words, param)
local config = {
	level = 100,
	storage = 50001
}
	if(getPlayerStorageValue(cid, config.storage) == 1) then
		doCreatureAddHealth(cid, - getCreatureHealth(cid))
		setPlayerStorageValue(cid, config.storage, -1)
		return true
	end
	if(getPlayerStorageValue(cid, config.storage) ~= 1 and getPlayerLevel(cid) >= config.level) then
		doPlayerPopupFYI(cid, 'Do you really wanna suicide? Say suicide again.')
		setPlayerStorageValue(cid, config.storage, 1)
		return true
	end
	if(getPlayerLevel(cid) < config.level) then
		doPlayerSendCancel(cid, "Only players with level ".. config.level .." or higher can suicide.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
	return true
end
 
doCreatureAddHealth(cid, - getCreatureHealth(cid)
Oh , somehow I couldn't use this on mine, I guess I had forgot to put (cid).

Well zonet, I guess your script could be the final version.
 
I think mines good, but you can also take out "checking if in fight." :thumbup:
And change it with checking for level.
 
I would add also creatureevent script to this onLogin, thet if you have getStorageValue(cid,28999) > 0 then make this storage -1 (with yours scripts you are asking for 'sure' only 1st time u say suicide. Next times you are killed immendially.
 
pretty good, exept for the mass murder in pz zone, but thats an easy fix i guess :)

TY
 
Back
Top