English I need this script plz!(not big)

19 replies
Goto Page
To the start Previous 1 Next To the start
Up
H-X
User
Offline Off
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.
Maths is the most magical place where you buy 70 watermelons and no one cares about it.
13.07.13 05:50:41 pm
Up
Rainoth
Moderator
Offline Off
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.
Code:
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
Code:
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
13.07.13 05:53:30 pm
Up
sheeL
User
Offline Off
Code:
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
13.07.13 05:59:02 pm
Up
H-X
User
Offline Off
thx for this shell but i am getting this error

LUA error >


and user Rainoth: your script dont work
edited 1×, last 13.07.13 06:02:47 pm
Maths is the most magical place where you buy 70 watermelons and no one cares about it.
13.07.13 06:01:48 pm
Up
Rainoth
Moderator
Offline Off
Code:
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
13.07.13 06:03:33 pm
Up
Avo
User
Offline Off
Code:
1
if aw == nil then aw == {}

How about:
Code:
1
if not aw then aw = {} end

or
*edit
Code:
1
aw = aw or {}

?
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
13.07.13 06:06:02 pm
Up
sheeL
User
Offline Off
sorry, my mistake

Code:
1
if aw == nil then aw = {}
13.07.13 06:06:45 pm
Up
H-X
User
Offline Off
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>'
Maths is the most magical place where you buy 70 watermelons and no one cares about it.
13.07.13 06:30:53 pm
Up
Rainoth
Moderator
Offline Off
In the first line add an "end"

@user sheeL: Sheesh. Such nonsense mistakes
13.07.13 06:36:03 pm
Up
Avo
User
Offline Off
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 >
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
13.07.13 06:42:38 pm
Up
H-X
User
Offline Off
now user sheeL's lua is ok but i will test bolt's lua now
Code:
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!
Maths is the most magical place where you buy 70 watermelons and no one cares about it.
13.07.13 06:49:37 pm
Up
Avo
User
Offline Off
Here you are. Have fun with it.
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
13.07.13 08:27:34 pm
Up
Varna97
User
Offline Off
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

Code:
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
IMG:http://steamsignature.com/status/english/76561198124843516.png
13.07.13 08:54:38 pm
Up
Avo
User
Offline Off
@user Varna97: Problem is solved. Didn't you notice?
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
13.07.13 09:04:03 pm
Up
Rainoth
Moderator
Offline Off
I suspect multi accounting on Sonic Black Knight.
13.07.13 09:53:31 pm
Up
sheeL
User
Offline Off
@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

Code:
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
13.07.13 10:46:28 pm
Up
Avo
User
Offline Off
@user sheeL:
Tell my, why the hell do you put semi-colons at end of random lines?
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
14.07.13 12:15:20 am
Up
sheeL
User
Offline Off
user Avo has written:
@user sheeL:
Tell my, why the hell do you put semi-colons at end of random lines?


i like, problem?
14.07.13 12:25:22 am
Up
Infinite Rain
Reviewer
Offline Off
user Avo has written:
@user sheeL:
Tell my, why the hell do you put semi-colons at end of random lines?
Why not?
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
14.07.13 08:59:32 am
Up
H-X
User
Offline Off
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??
Maths is the most magical place where you buy 70 watermelons and no one cares about it.
To the start Previous 1 Next To the start