Forum

> > CS2D > Scripts > I need this script plz!(not big)
Forums overviewCS2D overview Scripts overviewLog in to reply

English I need this script plz!(not big)

19 replies
To the start Previous 1 Next To the start

old I need this script plz!(not big)

H-X
User Off Offline

Quote
Hey all us ,
i was thinking there are alot of good lua scripters in USGN and they can help me with this lua.

LUA must be like this when a player picks a weapon a message comes:
LUA >


WELL thank you who ever helps me!
INFO
Sorry if i have bad English.

old Re: I need this script plz!(not big)

Rainoth
Moderator Off Offline

Quote
1. It's unreal software not USGN.
2. You want player to be killed yet you use command "kick"
3. I believe there would be no need for that if the player is stripped if he takes an admin weapon.

Sorry if this won't work, I did it in a big rush and I'm not an expert in tables/items. If you get error, tell me and me (and hopefully others) will try to fix it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
item = {3,32,45}
admin = {15476}

addhook("walkover","adminlikespotatos")
function adminlikespotatos(id,iid)
	for _,usgn in ipairs(admin) do
	for k,v in ipairs(item) do
		if not player(id,"usgn") == usgn then
			if iid == v then
				msg2(id,"Bro, you took something that's for admin...")
				parse("strip "..id.." "..iid)
			end
		end
	end
	end
end

EDIT : Just noticed the other question.
1. Arguments for function are (id,text) yet you check
1
if txt == "potato" -- NOT text but txt
so either change the argument or the IF check.
2. Help part is fine.
3. In minute hook you didn't write function to be called properly. (you wrote "add but not "add"
4. For the admin part. I'm not sure, if someone could say how to check if there's a usgn which belongs to admin (since "if player(id,"usgn")==" refers directly to person who says it >.<) I'd make it... Sorry that I can't help you with that.

I'd also advise to use code tags next time [.code][./code] (don't write dots)
edited 1×, last 13.07.13 05:59:04 pm

old Re: I need this script plz!(not big)

sheeL
User Playing CS2D

Quote
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
35
36
37
38
39
40
41
42
if aw == nil then aw == {}

aw.listwpn = {45,81,85} -- Your admins weapon here
adminlist = {12345,32140,45813} -- admin list here


addhook("walkover","OnPlayerUpdate")
function OnPlayerUpdate(id,iid,type)
		for i,itemid in pairs(aw.listwpn) do
			if type==itemid then
				for _, us in pairs(adminlist) do
				if usgn == us then
			return 0
		else
			msg2(id,"©255000000[SERVER] - Drop this weapon or you die in...");
			timer(10000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 3");
			timer(20000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 2");
			timer(30000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 1");
			timer(40000,"parse","killplayer "..id);
			msg("©192192192"..player(id,"name").." Has been killed my picking a admin weapon");
			return 0
			end
			end
		end
	end
end

addhook("say","OnPlayerText")
function OnPlayerText(id,value)
	if string.lower(value) == "!admin" then
		for _, us in pairs(adminlist) do
			if usgn == us then
			msg2(id,"©000255000Admin online : "..player(us,"name"));
			end
		end
	return 1
end

addhook("minute","OnServerUpdate")
function OnServerUpdate(value)
	 msg("©250000000 this server is fucked up go OUT!!.");
end

Untested, but is good idea

old Re: I need this script plz!(not big)

Rainoth
Moderator Off Offline

Quote
1
if aw == nil then aw = {}
That will fix his code.
Also. He placed timers so it works in 10/20/30/40 seconds instead of 1/2/3/4 so delete one zero in each timer

old Re: I need this script plz!(not big)

H-X
User Off Offline

Quote
coll it works

but i get this lua error now with !admin cmd

LUA ERROR: sys/lua/stt.lua:42: 'end' expected (to close 'function' at line 29) near '<eof>'

old Re: I need this script plz!(not big)

Avo
User Off Offline

Quote
I just couldn't look at user sheeL's "script". I wonder why his admin panel has got 52 likes. Probably he didn't make it by himself. Anyway, here is mine:

Spoiler >

old Re: I need this script plz!(not big)

H-X
User Off Offline

Quote
now user sheeL's lua is ok but i will test bolt's lua now
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
35
36
37
38
39
40
41
42
43
if aw == nil then aw = {} end

aw.listwpn = {45,81,85} -- Your admins weapon here
adminlist = {12345,32140,45813} -- admin list here


addhook("walkover","OnPlayerUpdate")
function OnPlayerUpdate(id,iid,type)
          for i,itemid in pairs(aw.listwpn) do
               if type==itemid then
                    for _, us in pairs(adminlist) do
                    if usgn == us then
               return 0
          else
               msg2(id,"©255000000[SERVER] - Drop this weapon or you die in...");
               timer(1000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 3");
               timer(2000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 2");
               timer(3000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 1");
               timer(4000,"parse","killplayer "..id);
			timer(5000,"parse","sv_msg "..player(id,"name").." Has been killed my picking a admin weapon");
               return 0
               end
               end
          end
     end
end

addhook("say","OnPlayerText")
function OnPlayerText(id,value)
     if string.lower(value) == "!admin" then
          for _, us in pairs(adminlist) do
               if usgn == us then
               msg2(id,"©000255000Admin online : "..player(us,"name"));
               end
          end
     return 1
end
end

addhook("minute","OnServerUpdate")
function OnServerUpdate(value)
      msg("©250000000 this server is fucked up go OUT!!.");
end

i have tested user Avo's lua and its better then user sheeL's

nice work BOLT!

old Re: I need this script plz!(not big)

Varna97
User Off Offline

Quote
user H-X has written
adminlist = {xxxxx}

for _, us in pairs(adminlist) do
               if usgn == us then
----in adminlist the admin can pick up the weapon but other die ----

if player pick these weapons = {"45","83","bla bla"}then

                    msg2(id,"Drop the weapon or you will die in"@C)
               msg2(id,"3")
          msg2(id,"2")
     msg2(id,"1")
msg2(id,"0")
          parse("kick "..id..)
     msg("©192192192"..player(id,"name").."Has been killed my picking a admin weapon")
          end
     end
end


You Want When Player Pick Admin items will be kick or kill ?
i like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
adminlist = {xxxxx}

for _, us in pairs(adminlist) do
			if usgn == us then
----in adminlist the admin can pick up the weapon but other die  ]:) ----

if player pick these weapons = {"45","83"}then

				msg2(id,"Drop the weapon or you will die in"@C)
			msg2(id,"3")
		msg2(id,"2")
	msg2(id,"1")
msg2(id,"0")
		parse("killplayer "..id..)
	msg("©192192192"..player(id,"name").."Has been killed my picking a admin weapon")
		end
	end
end

old Re: I need this script plz!(not big)

sheeL
User Playing CS2D

Quote
@user Rainoth: Are you blind?, I said I have not tested, is a base
@user Avo: i created yes, and I made a new version that i will not post, here is the IP of my server: 200.98.161.6:36963 with TheadminPanel v3.0

@edit : I Created new script for you @user H-X: , Tested and worked

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
if aw == nil then aw = {} end
aw.listwpn = {32,30,1} -- Your admins weapon here
aw.adminlist = {45813} -- admin list here


isAdmin = function(id)
     local us = player(id, "usgn")
     for _,v in pairs(aw.adminlist) do
          if us == v then
               return true
          end
     end
     return false
end

addhook("walkover","_walkover")
addhook("say","_say")
addhook("minute","_minute");


_walkover = function(id,iid,type)
	for i,itemid in pairs(aw.listwpn) do
		if type==itemid then
			if isAdmin(id) then
			return 0
		else
			_message(id)
			return 0
			end
		end
	end
end

function _message(id)
	timer(1000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 3"); timer(2000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 2"); timer(3000,"parse","sv_msg2 "..id.." ©255000000[SERVER] - 1"); msg2(id,"©255000000[SERVER] - Drop this weapon or you die in..."); timer(3700,"_checkwpn",id)
end

_say = function(id,text)
		if string.lower(text) == "!admin" then
			for x = 1,32 do
				if isAdmin(x) then
				msg2(id,"©000255000[SERVER] - Admin online : "..player(x,"name"));
			end
		end
	return 1
	end
end

_minute = function(id)
	msg("©250000000 this server is fucked up go OUT!!.");
end

_checkwpn = function(id)
	for i,itemid in pairs(aw.listwpn) do
		for _, w in ipairs(playerweapons(id)) do
			if (w==itemid) then
			msg("©192192192"..player(id,"name").." Has been killed my picking a admin weapon");
			parse("killplayer "..id);
			end
		end
	end
end
edited 4×, last 13.07.13 10:39:16 pm

old Re: I need this script plz!(not big)

H-X
User Off Offline

Quote
great sheeL's lua is very good now BUT bolt's lua is better no bugs!
and bolt i was thinking can you add some thing like that can strip the armors??
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview