Action Right click ---> remove frags.

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
Hello, i requested a script and someone posted it, it was talkaction but now i decided to make it to Action(onUse)

Here is it.

Credits -
slawkens script.
edited to onUse by Zonet ;)


-- credits
-- slawkens script edited by zonet to onUse


PHP:
local config =
{
	item = itemid,  -- itemid the item you right click on and reset your frags.
	level = 10,
	count = 1
}

function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your "..getPlayerRedSkullTicks(cid).." frags has been removed.")
		doRemoveItem(item.uid)
		doPlayerSetRedSkullTicks(cid, 0)
	else
		doPlayerSendCancel(cid, "You dot have enough level")
	end
	return TRUE
end
hope you like it.


Zonet, ;)


NOT TESTED
 
Last edited:

Keraxel

Ω Obfuscator Ω
Joined
Feb 2, 2008
Messages
941
Best answers
0
Reaction score
5
Location
Republic of Poland
Nothing special compared to slawkens script. You didn't add anything, only changed type of script.
 

ScorpiOOn93

etherno.net
Joined
Jun 19, 2008
Messages
662
Best answers
0
Reaction score
0
Location
CookieLand :DDD
omg
Its 10 seconds :/ You only changed one line, so all credits goes to slwakens.

...but its still not working on tfs 0.2 beacouse of "doPlayerSetRedSkullTicks" :|
 
OP
Zonet

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
Man, his script didn't even work when you said !resetfrag.. i maked the problem.. it also worked but it didn't remove the item.

I didn't say anything? i told it is slawkens so why flaming? i maked this for people who want a onUse instead onSay?
 

Don Daniello

/root
Staff member
Administrator
Joined
Apr 11, 2008
Messages
3,523
Best answers
15
Reaction score
932
Location
Proland
I wrote it about month ago in XX minutes (ye I don't know LUA very well)
 

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,833
Best answers
0
Reaction score
184
Im not sure, but:
Code:
doPlayerRemoveItem(cid, config.item, config.count)
If the player do not have the specified item it will print an error in the console?
 

Don Daniello

/root
Staff member
Administrator
Joined
Apr 11, 2008
Messages
3,523
Best answers
15
Reaction score
932
Location
Proland
for me it always works :) (I have it like the same)
 

slawkens

Developer
Premium User
Joined
Aug 27, 2007
Messages
2,874
Best answers
61
Reaction score
390
Location
Germany
Im not sure, but:
Code:
doPlayerRemoveItem(cid, config.item, config.count)
If the player do not have the specified item it will print an error in the console?
yep, here it should be doRemoveItem(item.uid) instead.
 

Tufte

Member
Joined
Nov 19, 2007
Messages
652
Best answers
0
Reaction score
23
Location
Norway
how can you send an animated text with like 30 letters? 9 is max?
also, why would you want a config for your item? you have already specified the item in the xml.. total waste :p its not a bad script, but you should think a bit more before you decleare it as releaseable ;)

also, what happens if you put the item on the ground and click on it? you answer
 

Keraxel

Ω Obfuscator Ω
Joined
Feb 2, 2008
Messages
941
Best answers
0
Reaction score
5
Location
Republic of Poland
As Colandus said
Code:
if getPlayerLevel(cid) >= level then
should be
Code:
if getPlayerLevel(cid) >= config.level then
 
OP
Zonet

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
@up

oooh didnt see, sorry.

*doRemoveItem(item.uid) (added).

*config.level (added)

*doSendAnimatedText(removed)

replaced doPlayerSendTextMessage over the doPlayerSetRedSkullTicks(cid, 0) so it says the frags before it removes and says Your 0 Frags will be removed.. now it will say how many frags you got.. that's why i replaced it before doPlayerSetRedSkullTciks before doPlayerSendTextMessage.

;)
 
Last edited:

kokorec

Tavon Online - Soon
Joined
May 3, 2008
Messages
287
Best answers
0
Reaction score
0
Location
Turkey
i use TFS 0.2.i have problem:
Code:
[09/01/2009  18:43:12] Lua Script Error: [Action Interface] 
[09/01/2009  18:43:12] data/actions/scripts/removelist.lua:onUse

[09/01/2009  18:43:12] data/actions/scripts/removelist.lua:10: attempt to call global 'getPlayerRedSkullTicks' (a nil value)
[09/01/2009  18:43:12] stack traceback:
[09/01/2009  18:43:12] 	data/actions/scripts/removelist.lua:10: in function <data/actions/scripts/removelist.lua:8>
script only for TFS 0.3?
 
OP
Zonet

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
i use TFS 0.2.i have problem:
Code:
[09/01/2009  18:43:12] Lua Script Error: [Action Interface] 
[09/01/2009  18:43:12] data/actions/scripts/removelist.lua:onUse

[09/01/2009  18:43:12] data/actions/scripts/removelist.lua:10: attempt to call global 'getPlayerRedSkullTicks' (a nil value)
[09/01/2009  18:43:12] stack traceback:
[09/01/2009  18:43:12] 	data/actions/scripts/removelist.lua:10: in function <data/actions/scripts/removelist.lua:8>

script only for TFS 0.3?
Yep it is only for 0.3 cuz 0.2 dont got the function getPlayerRedSkullTicks
 

Illusion Storm

Zakładam kominiare.
Joined
Aug 28, 2008
Messages
377
Best answers
0
Reaction score
0
work, rep++ i search it ;PP

can make this for namelock?
 
Top