Forum
CS2D Scripts Lua Scripts/Questions/Help Decks has written
but that scrypt can be very helpful in matches
Make it by yourself and claim the infinite honour (and therefore, print your name in the humanity's history) for making a useful script for CS2D.
i need to know ho i can return an id of an object.
info.txt has written
build(id,type,x,y,mode,objectid) on (effective) build
-id: player id
-type: building type
-x: building x (tiles)
-y: building y (tiles)
-mode: building mode
-objectid: id of new building object
>return: 0 - proceed normally
1 - don't build
-id: player id
-type: building type
-x: building x (tiles)
-y: building y (tiles)
-mode: building mode
-objectid: id of new building object
>return: 0 - proceed normally
1 - don't build
However, I don't know how would you get the id of a building you have created through parsing/command line.
Edit:
Maybe
1
2
3
2
3
--parse(make some building) local asd = object(0,"table") local building_id = asd[#asd] --The last item should be the newest building, right?
Question:For what stands this:local building_id = asd[#asd]
edit: wooow it works
edited 1×, last 23.03.10 11:11:03 pm
I am not sure if anyone needs them but you might beable to use io.copy for quickly backing up data
use them as you please but at least have the dignity to give me credit
Like this:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
function io.copy(old,new) 	old = assert(io.open(old,"r"),"FILE NOT FOUND") 	new = io.open(new,"r") 	if not new then 		new=io.open(new,"w") 	else 		error("FILE ALREADY EXISTS") 	end 	new:write(old:read("*a")) 	old:close() 	new:close() end
edited 1×, last 25.03.10 05:18:06 am
But i don't want that he has full ammo.
Can I strip ammo in Lua?
The Code:
1
2
3
4
5
2
3
4
5
addhook("spawn","mspawn") function mspawn(id) 	parse("equip "..id.." 42") 	--How to strip ammo? end
Patasuss has written
I want to spawn a player with a M4A1 .
But i don't want that he has full ammo.
Can I strip ammo in Lua?
The Code:
But i don't want that he has full ammo.
Can I strip ammo in Lua?
The Code:
1
2
3
4
5
2
3
4
5
addhook("spawn","mspawn") function mspawn(id) 	parse("equip "..id.." 42") 	--How to strip ammo? end
Ugh, you can't strip ammo (I am not sure how). And 42 isn't M4A1. It's 32.
It also haves a weapon store.
You are allowed to edit it.
But please do not claim as your own and if you
modify this script and give it to another person please give credits and do not cut out the information at the top of the file.
but isnt the same have less things but i want to have it ...
please help-me FAST!
/Edit/
Omg help Me!!! o.o
edited 1×, last 27.03.10 07:11:38 pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
asked_for_help_in_us = {} for i=1,32 do asked_for_help_in_us[i] = false end addhook("say","_say_") function _say_(id,t) 	if t=="helpmewithmyluascript" then 		menu(id,"Chose where will you ask for help:, Google.com|Fast and easy, Common Sense|Not widely used but very effective,Unrealsoftware.de|Maybe the guys know what the hell is wrong") 	end end addhook("menu","_menu_") function _menu_(id,t,b) 	if t == "Chose where will you ask for help:" then 		if b == 3 then 			if asked_for_help_in_us[id] == false then 				print("Posting in Lua Scripts/Questions/Help") 				asked_for_help_in_us[id] = true 			else 				parse('sv_msg2 '..id..' "You have already asked for help, don't spam the forums" ') 			end 		end 	end end
1
parse('sv_msg2 '..id..' "You have already asked for help, don't spam the forums" ')
true is:
1
msg2(id,"You have already asked for help, don't spam the forums")
i Know server name is 'sv_name' but i don't know ip