English trigger_if weapons striping

3 replies
Goto Page
To the start Previous 1 Next To the start
15.06.16 01:24:42 pm
Up
I searched for similar thread but didnt find anything...
     I want to know if there is some form of trigger_if that one could use to disarm player?
What i mean is this: you walk around map, everything is cool, you step on trigger_move (which is conected to trigger_if) and boom, you have no weapon.

Is this even posible? If it is, what do i need to write in trigger_if?
( ͡° ͜ʖ ͡°) lol kek cheburek ( ͡° ͜ʖ ͡°)
15.06.16 01:39:37 pm
Up
Oops321
User
Offline Off
thread cs2d Teleporting Players with Trigger_If


DC has written:
cs2d entity trigger_if is designed to be used for simple conditions / evaluations. It's not designed to run complex Lua scripts or scripts which actually do something. That's why it is called trigger_if and not trigger_lua or whatever. That's also why the text box is so small.


also you can't make it by using Trigger_if, here is reason
DC has written:
cs2d entity trigger_if doesn't know who used the cs2d entity trigger_use! That's a big problem because we need that info!

You can just write script for it
Code:
1
2
3
4
5
6
7
8
9
10
11
12
MX = 1 -- write Trigger_move's x coordinate
MY = 2 -- write Trigger_move's y coordinate

addhook("movetile","cleanbutt")
function cleanbutt(id,x,y)
     if ( x == MX and y == MY ) then 
     parse("explosion "..(x*32+16).." "..(y*32+16).." 100 0")
          for _,w in pairs(playerweapons(id)) do
          parse("strip "..id.." "..w)
          end
     end
end
Lastest upload : file cs2d fix the collecting (0)
15.06.16 01:44:30 pm
Up
I dont understand that scripts, where to write it and even how to use it... But still, thanks for quick response
( ͡° ͜ʖ ͡°) lol kek cheburek ( ͡° ͜ʖ ͡°)
15.06.16 01:47:58 pm
Up
HPB
User
Offline Off
Put the script in a .lua file with same name as your map and same folder (maps).
To the start Previous 1 Next To the start