Forum

> > CS2D > Scripts > Image Drop And Take
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Image Drop And Take

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Image Drop And Take

xSkyLordx
User Off Offline

Zitieren
Hello everybody, i need one Lua script Image Drop and take
im asking everybody for 3 week but no body help me

i want make Tshirt

Thanks ..

alt Re: Image Drop And Take

Yates
Reviewer Off Offline

Zitieren
He wants a script like Tibia, where you have a scripted item which can be dropped and picked up. With that he will make a T-shirt. Nothing hard about that there omg.

alt Re: Image Drop And Take

xSkyLordx
User Off Offline

Zitieren
@user Yates: He wants a script like Tibia, where you have a scripted item which can be dropped and picked up. With that he will make a T-shirt. Nothing hard about that there omg.

Yes i want this one

alt Re: Image Drop And Take

omg
User Off Offline

Zitieren
ohh...it doesnt make sense when u dont know english and word it funny
u wanna make a tshirt with it? i dont understand...nvm

alt Re: Image Drop And Take

SkullzOrig
User Off Offline

Zitieren
He just wants to make new equipment with different powers. In other words, he just wants to copy from tibia and add to whatever it is he is making. Thats easy, pretty sure he could do himself.
DON'T BE LAZY LEARN TO DO YOURSELF!
Since the script is already done.

alt Re: Image Drop And Take

TimeQuesT
User Off Offline

Zitieren
One of my unreleased scripts...

Mehr >

alt Re: Image Drop And Take

J4x
User Off Offline

Zitieren
Create a new text file, paste the code there and change the file extension to .lua. Then copy the name of the file and add the file to cs2d/sys/lua then add this to server.lua: dofile("sys/lua/nameofyoufile.lua")

alt Re: Image Drop And Take

EP
User Off Offline

Zitieren
I made an example for you, I have explained everything here, hope you will understand it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
items = {} -- maintable for items on the floor
function additem(x,y,img) -- just an example, adding an item with pos X,Y
	local newitem = {} -- a simple table to the new item
	newitem.x = x -- putting X pos
	newitem.y = y -- putting Y pos  
	newitem.img = image(img,0,0,1) -- putting an image to the item
	table.insert(items,newitem) --inserting the newitem to the items maintable
end

addhook("use","d")
function d(id,e,d,x,y)
	for k,v in ipairs(items) do -- reading the items maintable
		if v.x ~= nil then
			if player(id,"tilex") == v.x/32 and player(id,"tiley") == v.y/32 then --checking if some item have the same position of the player
				msg2(id,"You have picked up an item") -- You have picked up an item!
				freeimage(v.img) -- finally, remove the item from the map
				v.x,v.y = nil,nil -- later.... remove the table of that item
			end
		end
	end
end

addhook("serveraction","c")
function c(id,a)
	if a == 2 then -- if F3...
		local x,y = player(id,"tilex")*32,player(id,"tiley")*32 -- the pixels of the player, it is more efficient
		additem(x,y,"gfx/flare1.bmp") -- adding an item at the player's position
		imagepos(items[#items].img,x+16,y+16,0) -- putting the right position of the image, with a x,y offset of 16 to centre it ;D
	end -- endif
end -- endfunction
Press F3 to drop an item, and press the use button "E" to pick up an item.
Edit it as you want, giving credits aswell.
2× editiert, zuletzt 10.06.12 23:49:25

alt Re: Image Drop And Take

Navy Seal
User Off Offline

Zitieren
user Sparty hat geschrieben
I hate it why someone makes a thread JUST to ask someone to make a script

That is still better than "what is your favprite" topics.

alt Re: Image Drop And Take

xSkyLordx
User Off Offline

Zitieren
user EP hat geschrieben
I made an example for you, I have explained everything here, hope you will understand it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
items = {} -- maintable for items on the floor
function additem(x,y,img) -- just an example, adding an item with pos X,Y
	local newitem = {} -- a simple table to the new item
	newitem.x = x -- putting X pos
	newitem.y = y -- putting Y pos  
	newitem.img = image(img,0,0,1) -- putting an image to the item
	table.insert(items,newitem) --inserting the newitem to the items maintable
end

addhook("use","d")
function d(id,e,d,x,y)
	for k,v in ipairs(items) do -- reading the items maintable
		if v.x ~= nil then
			if player(id,"tilex") == v.x/32 and player(id,"tiley") == v.y/32 then --checking if some item have the same position of the player
				msg2(id,"You have picked up an item") -- You have picked up an item!
				freeimage(v.img) -- finally, remove the item from the map
				v.x,v.y = nil,nil -- later.... remove the table of that item
			end
		end
	end
end

addhook("serveraction","c")
function c(id,a)
	if a == 2 then -- if F3...
		local x,y = player(id,"tilex")*32,player(id,"tiley")*32 -- the pixels of the player, it is more efficient
		additem(x,y,"gfx/flare1.bmp") -- adding an item at the player's position
		imagepos(items[#items].img,x+16,y+16,0) -- putting the right position of the image, with a x,y offset of 16 to centre it ;D
	end -- endif
end -- endfunction
Press F3 to drop an item, and press the use button "E" to pick up an item.
Edit it as you want, giving credits aswell.


Thank you, ı edited this. Now hat can drop thanks
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht