TalkAction My suicide script.

Rozinx

New Member
Joined
Aug 17, 2009
Messages
851
Best answers
0
Reaction score
1
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:

Synthetic_

deathzot.net
Joined
Dec 30, 2008
Messages
2,535
Best answers
0
Reaction score
568
Can be abused, if someone hits you just suicide and get people frags?
 
OP
Rozinx

Rozinx

New Member
Joined
Aug 17, 2009
Messages
851
Best answers
0
Reaction score
1
Makes sense, I'll try to rewrite it in order to be only used if the player has no pz lock nor battle sign.
 
OP
Rozinx

Rozinx

New Member
Joined
Aug 17, 2009
Messages
851
Best answers
0
Reaction score
1
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.
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
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
 
OP
Rozinx

Rozinx

New Member
Joined
Aug 17, 2009
Messages
851
Best answers
0
Reaction score
1
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
 

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
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
 
OP
Rozinx

Rozinx

New Member
Joined
Aug 17, 2009
Messages
851
Best answers
0
Reaction score
1
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.
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
I think mines good, but you can also take out "checking if in fight." :thumbup:
And change it with checking for level.
 

QuaS

Cykotitan Pwned =/
Joined
Sep 11, 2008
Messages
833
Best answers
0
Reaction score
26
Location
Poland/ Wroclaw
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.
 

EmmaH

Software Developer
Joined
Jan 26, 2009
Messages
3
Best answers
0
Reaction score
0
Location
Sydney
Forget it
 
Last edited:

Wesker

Member
Joined
Sep 26, 2011
Messages
223
Best answers
0
Reaction score
6
pretty good, exept for the mass murder in pz zone, but thats an easy fix i guess :)

TY
 
Top