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

Requesting 2 Scripts

Sonnyxz

New Member
Joined
Jan 8, 2009
Messages
34
Reaction score
1
Location
Brasil
Hello, I'm asking for two simple scripts, their definition is below:

First Script :
I would like a script when the player dies if it has magic level above 150, it loses at least one magic level, why not know what happens after he passes the magic level of 150 when he dies loses only 3% of its magic level ...

Second Script :
Well personally I would like a script to remove frags (Only one Frag) of players for each 1kk Frag, I even have a script here, the more it removes all the frags at once ... I would like to remove only one frag.


Sorry for my bad english, I'm using google translator.

Thanks in advance and..
Rep++
 
You didn't give much detail, but here..

Second as a MOD:

fragremove.xml


XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Arthur" contact="otland.net" enabled="yes">
	<action itemid="xxxx" event="script"><=!=[=C=D=A=T=A=[
			db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
			doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
			doRemoveItem(item.uid, 1)
		end
		return true
	]=]=></action>
</mod>
 
Last edited:
Rather
Lua:
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ") LIMIT 1;")
 
Second as a MOD:

fragremove.xml


XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Arthur" contact="otland.net" enabled="yes">
	<action itemid="xxxx" event="script"><=!=[=C=D=A=T=A=[
			db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ") LIMIT 1;")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
			doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
			doRemoveItem(item.uid, 1)
		end
		return true
	]=]=></action>
</mod>

ty cykofag.

damn LIMIT 1. c,c
 
Last edited:
_Arthur, like that it will only remove the frag is player have one frag.. he wants is just to remove one frag.. here


XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Arthur" contact="otland.net" enabled="yes">
	<action itemid="xxxx" event="script"><=!=[=C=D=A=T=A=[
local frags = getPlayerFrags(cid)
local n = frags-1
                   db.executeQuery("UPDATE `killers`SET `unjustified` = "..n.." WHERE `unjustified` = "..frags.."  AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
			doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
			doRemoveItem(item.uid, 1)
		end
		return true
 ]=]=></action>
</mod>
 
_Arthur, like that it will only remove the frag is player have one frag.. he wants is just to remove one frag.. here


XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Arthur" contact="otland.net" enabled="yes">
	<action itemid="xxxx" event="script"><=!=[=C=D=A=T=A=[
local frags = getPlayerFrags(cid)
local n = frags-1
                   db.executeQuery("UPDATE `killers`SET `unjustified` = "..n.." WHERE `unjustified` = "..frags.."  AND `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
			doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
			doRemoveItem(item.uid, 1)
		end
		return true
 ]=]=></action>
</mod>
No, there is a row for each frag. Column unjustified can only be 0 or 1.
 
none of the scripts posted worked...
An error occurred in console

OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "killers" SET "unjustified" = 0 WHERE "unjustified" = 1 AND "id" IN (SELECT "kill_id" FROM "player_killers" WHERE "player_id" = 3) LIMIT 1;)

appreciate everyone's help, I will be waiting waiting ...
 
thank Arthur and Cykotitan, I'm using the mysql databas in now and is working perfectly, now we just need another script:)

Rpp + + for the two who helped me!
 
Back
Top