English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 204 205 206 ... 338 339 Next To the start
25.05.10 03:45:51 pm
Up
Sudden Death
User
Offline Off
eh i can't make lua, ok i now make other idea more simple, who can make "When player stand x-10 and y-10 then player speedmod is 20":d i know its simple but i don't understand it..
edit: The "10" is title or pixels??
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
25.05.10 06:41:24 pm
Up
DRoNe
User
Offline Off
try this :
Code:
1
2
3
4
5
6
7
function speed(id)
local plx = player(id,"tilex")
local ply = player(id,"tiley")
     if plx == 10 and ply == 10 then
          parse ("speedmod "..id.." 20")
     end
end

player(id,"x"), player(id,"y") = player pixel pos
player(id,"tilex"), player(id,"tiley") = player tile pos

x,y can be sometimes tile pos

edited 3×, last 25.05.10 08:42:32 pm
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
26.05.10 01:14:42 am
Up
Heartless Soldier
User
Offline Off
Hey!, I made a little code wich when you join the game with two clients or more, if you try to vote with some client (except with the first) you are kicked.
This is the code:

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
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

clon = initArray(32)

addhook("join","onjoin")
function onjoin(id)
     clon[id] = 0
     local setip = player(id,"ip")
     for i = 1,32 do
          if not i == id then
               if player(i,"ip")==setip then
                    clon[id] = 1
               end
          end
     end
end
addhook("vote","onvote")
function vota(id,mode,param)
     if clon[id]==1 then
          parse("kick "..id)
     end
end


But for a reason it doesn't work.
IS like when you join with a new client your ip changes, but i made a test, so when i said "!ip" it telled me the ip, and both had the same ip :S.

Any help?
edited 1×, last 26.05.10 01:40:26 am
26.05.10 01:47:02 am
Up
archmage
User
Offline Off
I think player(id, "ip") always returns: 0.0.0.0
We must secure the existence of our people and a future for white children. 14/88
26.05.10 01:55:01 am
Up
Heartless Soldier
User
Offline Off
When the server is dedicated and you are the host it returns 0.0.0.0, but try with a normal server, it returns the real ip, at least works for me.
26.05.10 02:18:48 am
Up
Flacko
User
Offline Off
Why not just:
Code:
1
2
3
4
5
6
7
8
9
10
addhook("vote","onvote")
function onvote(id,mode,param)--BTW, you wrote vota instead of onvote
     if mode ~= 1 then return true end--Punishment only for votekicks
     local ip = player(id,"ip")
     for k,p in pairs(player(0,"table")) do
          if player(p,"ip") == ip and id ~= p then
               parse("kick "..id)
          end
     end
end

?
26.05.10 02:27:39 am
Up
siuL
User
Offline Off
Spoiler >

isnt working ... some 1 could help ?
26.05.10 04:54:06 am
Up
Trotskygrad
User
Offline Off
IF you want to do admin-authing by USGN, I recommend you make a list, auth on join and de-auth on leave, that way you're only checking a single param in that function.
26.05.10 09:31:34 pm
Up
Heartless Soldier
User
Offline Off
Flacko has written:
Why not just:
Code:
1
2
3
4
5
6
7
8
9
10
addhook("vote","onvote")
function onvote(id,mode,param)--BTW, you wrote vota instead of onvote
     if mode ~= 1 then return true end--Punishment only for votekicks
     local ip = player(id,"ip")
     for k,p in pairs(player(0,"table")) do
          if player(p,"ip") == ip and id ~= p then
               parse("kick "..id)
          end
     end
end

?


Thanks Flacko
28.05.10 06:31:33 am
Up
iCe4147
User
Offline Off
Can anyone help me out?
I need LUA where killer gets spawned to a certain place
I am so old school with this game
28.05.10 06:46:19 am
Up
archmage
User
Offline Off
Spoiler >

I do not know where you want them to spawn so it just spawns them at there current position.

Edit:
Is it possible without running through CS2D to make Lua play a sound, and not wxLua just Lua?
edited 1×, last 28.05.10 11:42:42 pm
We must secure the existence of our people and a future for white children. 14/88
29.05.10 02:59:48 am
Up
KenVo
User
Offline Off
How to make the bot randomly go to the teleport if it stand close to it? (then make it just keep going, not return to the tele again and again)

edited 1×, last 29.05.10 04:26:43 am
29.05.10 03:20:16 am
Up
Flacko
User
Offline Off
Dark Byte has written:
I do not know where you want them to spawn so it just spawns them at there current position.

Edit:
Is it possible without running through CS2D to make Lua play a sound, and not wxLua just Lua?

As far as I know Lua hasn't got any audiovisual facilities, you should look for a library or run your media player with some parameters so it loads your file
29.05.10 10:01:40 am
Up
iCe4147
User
Offline Off
Dark Byte has written:
Spoiler >


2480 1425
I am so old school with this game
29.05.10 11:17:32 am
Up
Admir
User
Offline Off
Yamato4147 has written:
Dark Byte has written:
Spoiler >


2480 1425


put that number in x and y

Code:
1
2
3
4
5
addhook("kill", "hook_kill")

function hook_kill (k, v, w, x y)
     parse("spawnplayer "..k.." 2480 1425")
end
My curse will sail against the wind and enrage the earth.
29.05.10 10:05:32 pm
Up
Promaster
User
Offline Off
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?

BY Alex
IMG:https://image.prntscr.com/image/J20O66l1RQGtFLeN9dmW6g.png
Patch 13.1! Updated. 2018-02-14
29.05.10 10:07:59 pm
Up
Cure Pikachu
User
Offline Off
Alexkiller2895 has written:
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?

BY Alex

What do you mean?
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
29.05.10 10:36:39 pm
Up
RAVENOUS
BANNED
Offline Off
To use lua-files rewrite/delete/whatever your server.lua in [b]sys/lua/server.lua[b] - The lua script which is saved as server.lua can now be used in your server
"A work of art is the unique result of a unique temperament." - Oscar Wilde
30.05.10 12:18:01 am
Up
archmage
User
Offline Off
Well, if you want to add them to your server do this:
Open "sys/lua/server.lua" (with notepad)
Type 'dofile ("sys/lua/<lua file>.lua")'

If you want to learn Lua go to
www.lua.org
We must secure the existence of our people and a future for white children. 14/88
30.05.10 12:20:45 am
Up
TimeQuesT
User
Offline Off
Alexkiller2895 has written:
I don't know how its work with Lau Files. can Anyone in this Forum help me with that`?

BY Alex

i can't help you because i don't understand you,pls explain better.
Muh
To the start Previous 1 2 ... 204 205 206 ... 338 339 Next To the start