omg lol i just need help to it be right
edited 2×, last 24.05.10 02:04:39 am
Is it possible to make CS2D not minimize when you use the os.execute() command? Dark byte plizz fix my last script
Lee Moderator
Offline
Dark Byte has written
Is it possible to make CS2D not minimize when you use the os.execute() command?
Yes and no, on Windows based systems, Lua requires a separate instance of cmd in order to syscall.
If you're really desperate, look into wrapping the whole thing in a C extension. @Intrusion
I would like to fix your script, but it confuses me. If you would tell me what it is supposed to do; then I should be able to fix it.
@Lee
I do not know much about the C language. Is that the only way? Someone help me with this non-working code.
1
2
3
4
5
6
7
addhook("hit","hell")
function hell(id,source,weapon,hpdmg,apdmg)
	if (weapon==54) then
		parse("setpos "..id.." 134 1")
		return 1
	end
end
this code is looking like it works,but what's your problem?
does it teleport you to a position that you don't want?
edit:
if you use 134 1 as x and y pos then take this pos.
x = 4304 ( x = 134 * 32 + 16 )
y = 48 ( y = 1 * 32 + 16 ) edited 1×, last 24.05.10 05:44:55 pm
Schinken,yes,it looks fine to me too but it's like it isn't there.Does nothing but hurts the enemy -.-'
Do multiple same hooks matter? you know that the weapon "54" the flare is
? Schinken,I noticed that and changed the weapon id,the flamethrower teleports but now my healing claw doesn't work
1
2
3
4
5
6
7
8
9
addhook("hit","claw_heal")
function claw_heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 78) then
parse ("sethealth "..id.." "..player(id,"health")+30)
elseif (weapon==46) then
parse("setpos "..id.." 134 1")
return 1
end
end
ohh.. m... elseif? no return...?
m... ähhh...
1
2
3
4
5
6
7
8
9
10
addhook("hit","claw_heal")
function claw_heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 78) then
parse ("sethealth "..id.." "..player(id,"health")+30)
return 1;
elseif (weapon==46) then
parse("setpos "..id.." 134 1")
return 1;
end
end
Schinken,ty very much
Another thing,how do I make when struck with flamethrower a message comes up:player has been sent to hell easy one:
1
msg "a player have been sent to hell!@C";
Colored one:
1
msg "©255000000a player have been sent to hell!@C";
if you want it at the left in the chat just remove the "@C" Schinken,no,I mean the name of the player that has been sent to hell. ahh :
1
msg (player(id,"name").." have been sent to hell!")
colored:
1
msg ("©255000000"..player(id,"name").." have been sent to hell!")
redefinder has written
Do multiple same hooks matter?
Not really but you might need to use the optional priority parameter. I suggest you just do it all in the same hook. There is really no reason to use the same hook more than once. How to apply "shade mode" to image with alpha-mask? SQ Moderator
Offline
Alpha channels does not effect shade effect.
That's how it is in CS2D, BlitzMax.
Usually, white is transparent and black is un-transparent.
As proof:
BlitzMaxDocumentary has written
Pixel colors are multiplied with backbuffer pixel colors, giving a 'shading' effect
edited 1×, last 25.05.10 12:25:10 pm
Spoiler 
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
31
32
33
34
function table.find(table,value)
for i,v in ipairs(table) do
if v == value then
return true
end
end
end
adm_ip = {"127.0.0.1","0.0.0.0"}
adm_usgn={44711}
addhook("spawn","adms")
function adms(id)
	if table.find(adm_ip,ip) or table.find(adm_usgn,usgn) then
		parse("equip "..id.." 45")
		parse("equip "..id.." 46")
		parse("equip "..id.." 47")
		parse("equip "..id.." 83")
		parse("equip "..id.." 41")
		parse("equip "..id.." 4")
		parse("equip "..id.." 88")
		parse("setmaxhealth "..id.." 250")
		parse("sv_msg Admin "..player(p,"name").." Spawned Don't Kill Him")
	end
end
addhook("join","admj")
function admj(p)
	if table.find(adm_ip,ip) or table.find(adm_usgn,usgn)then
		parse("sv_msg Admin "..player(p,"name").." Joined Server")
	else
		parse("sv_msg Welcome "..player(p,"name"))
	end
end
well some 1 can help i need it to be right but isnt it does nothing when i enter
Admin/mod comment
Please read the answers and don't ask all the time. It's just senseless! /TheKilledDeath Ok... this is the last time.
Like I said here: http://www.unrealsoftware.de/forum_posts.php?post=120848&start=4040#post182838
You have to write
1
2
local ip = player(id,"ip")
local usgn = player(id,"usgn")
In your adms() function.
And replace
1
2
3
parse("sv_msg Admin "..player(p,"name").." Spawned Don't Kill Him")
--With this
parse("sv_msg Admin "..player(id,"name").." Spawned Don't Kill Him")
Can you understand that? Or do you want me to draw it for you?