Files

> > CS2D > Lua Scripts > New Env_Item
Files overviewCS2D overviewLua Scripts overview

English New Env_Item >

6 comments2 kb, 389 Downloads

old New Env_Item

MikuAuahDark
User Off Offline

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:
1
dofile("sys/lua/newenv_item.txt")
• close and save server.lua and Have Fun

the command is mixable, it means that you can insert more that 1 command for example:
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 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 user MikuAuahDark made it
√ Reupload at another site(but give me credits)
× Steal
× Reupload on us.de
Approved by Seekay

Download Download

2 kb, 389 Downloads

Comments

6 comments
To the start Previous 1 Next To the start

Log in!

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

old

xSkyLordx
User Off Offline

hmm, amateurish but useful
I like it!

old

omg
User Off Offline

kratos, u obviously didnt even look at the code...

old

MikuAuahDark
User Off Offline

@user omg: i forgot to delete the tonumber
@user Avo: "You can use normal Env_Item to equip player. " yes but about strip and check not.

old

krabob
User Off Offline

@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
I like it!

old

omg
User Off Offline

wtf is this LOL
this contains some of the most repetitive code ive ever seen
example:
1
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
this part bothers me as well...
1
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
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

old

Avo
User Off Offline

It's practically nosense. You can use normal Env_Item to equip player.
To the start Previous 1 Next To the start