New Env_Item 
6 comments i create a new script again. it's called New Env_Item because it uses Env_Item entity for the system.
How To Use:
create Env_Item on map
open Env_Item properties
put the command on Trigger tab(Not name)
change the Item ID(of course) because this is second parameter that required
make sure that Spawn setting on "On Trigger only" so it not spawn
save the map and Have Fun
Commands:
equip - give the "Item ID(on Env_Item)" weapon
switch - set your weapon to "Item ID"(if you have)
strip - strip your "Item ID" weapon(if you have)
exists - it check are you have "Item ID" weapon or not
How To Install:
extract newenv_item.txt that on sys > lua to <cs2ddir>/sys/lua
open server.lua
add this on end of server.lua:
close and save server.lua and Have Fun
the command is mixable, it means that you can insert more that 1 command for example:
it give you "Item ID" and switch your weapon to "Item ID"
also there is a Example map that use "Item ID" to P90. if you want to use it, just extract Envitemtest.map located on maps folder to maps folder on CS2D
and of course is editable. so you can add more commands
but it little harder if you newbie.
Rights:
Use it at your server
Edit it w/o my permission(but don't reupload on us.de)
Say
MikuAuahDark made it
Reupload at another site(but give me credits)
Steal
Reupload on us.de
How To Use:






Commands:




How To Install:



Code:
1
dofile("sys/lua/newenv_item.txt")

the command is mixable, it means that you can insert more that 1 command for example:
Code:
1
equip switch
it give you "Item ID" and switch your weapon to "Item ID"
also there is a Example map that use "Item ID" to P90. if you want to use it, just extract Envitemtest.map located on maps folder to maps folder on CS2D
and of course is editable. so you can add more commands

Rights:








Comments
6 comments



Log in!
You need to log in to be able to write comments!Log in

@omg, tonumber makes string into a number, I think. It probably had been used because the function being called by a timer
about script: might come in useful for people
about script: might come in useful for people
wtf is this LOL
this contains some of the most repetitive code ive ever seen
example:
this part bothers me as well...
also, the code relies on the map which defeats the purpose of having it as a global script. the code is also in a .txt for some reason
this contains some of the most repetitive code ive ever seen
example:
Code:
1
2
3
4
5
2
3
4
5
function useequip(id,weapon)
id = tonumber(id)--id is already a number LOL! tonumber(id)==id!
weapon = tonumber(weapon)--same as above
parse("equip "..id.." "..weapon)--the functions only purpose was to do this? u might as well not have the function -.-
end
id = tonumber(id)--id is already a number LOL! tonumber(id)==id!
weapon = tonumber(weapon)--same as above
parse("equip "..id.." "..weapon)--the functions only purpose was to do this? u might as well not have the function -.-
end
this part bothers me as well...
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
if commands:find("equip")~=nil then
list.equip=true
end
...--later
if list.equip then--the code ends up using list.equip a second time later on for no reason...u could just move useequip() to after the first if statement and it would be shorter, better, and "list" wouldnt even need to be created
useequip(id,weapon)
end
list.equip=true
end
...--later
if list.equip then--the code ends up using list.equip a second time later on for no reason...u could just move useequip() to after the first if statement and it would be shorter, better, and "list" wouldnt even need to be created
useequip(id,weapon)
end
also, the code relies on the map which defeats the purpose of having it as a global script. the code is also in a .txt for some reason



