Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2137 138 139338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Flacko hat geschrieben
I didn't test it, but you can tell me about any errors you get.

It has this strange error:
LUA ERROR: sys/lua/rank.lua:8: attempt to call global 'weapons' (a nil value)

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
redefinder hat geschrieben
It has this strange error:
LUA ERROR: sys/lua/rank.lua:8: attempt to call global 'weapons' (a nil value)

Change eight line with this:
1
RANK.ADVANCED = {weapons[b]=[/b]{10},29569,29570,29571,29572,29573}

alt Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Zitieren
ok to make classes for T as own
and CT as own .i must do that
1
2
3
4
5
if (player(id,"team") == 2) then
[...]

elseif (player(id,"team") == 1) then
[...]

i put it on the script but still donot work i end it too ?

alt Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Zitieren
Eh, This little tid bit of code got me confused, since I don't see anything that resembles closely to that I don't know what to make of it.
Spoiler >

Eh, It didn't add the tabs.. -.-

alt Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Zitieren
YEA! THANKS!
Eh, your little _ before all your variables got me confused, made me think that it was some sort of a calling thing in lua Thanks,

Eh, I applied what you told me, And coincedences of coincedences, I'm doing almost the exact same script as redefinder, but, It's for a RPG server. Heres the script, and It's annoying me. Just need help with calling a specific variable/I don't know in a table. I took what you did.. Here it is
1
2
3
for index,id in ipairs(player(0,"table")) do
		for i,_Usgn in ipair(ADMIN.SuperAdmin2) do
	if player(id,"usgn") == _Usgn then
Alright what does this do, specificly the loop. Thanks
1× editiert, zuletzt 15.01.10 01:07:49

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
@Homer,
Check this out:
http://lua-users.org/wiki/TablesTutorial

Tutorial hat geschrieben
1
2
3
4
5
6
7
8
9
10
11
12
13
14
t[4] = "three"
t[6] = "eight"
t[2] = { "apple", "pear", "banana" }
for i,v in ipairs(t) do print(i,v) end

---
1       1
2       table: 0035DFE8
3       2
4       three
5       5
6       eight
7       13
8       21


In short, this should mean that:

"For i,value in ipairs(table) do"

i - current loop number. (Key)
value - value (table[])
in ipair() - let's say it's like "For each"
table - table...

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
When the key you put between brackets ([]) is a number, it's called an index, and that's why we use the i for loops

@Homer: What the script does is making a loop inside another loop.
1
for index,id in ipairs(player(0,"table")) do
Here we are transversing through all the players (We won't need the index variable, but id holds the id of the player)

1
for i,_Usgn in ipairs(ADMIN.SuperAdmin2) do
Here we loop through the usgns table, and once again, i is useless, but we will ned _Usgn

1
if player(id,"usgn") == _Usgn then
And here we compare the player's usgn with the usgn stored in our table.

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Homer hat geschrieben
I'm doing almost the exact same script as redefinder, but, It's for a RPG server.

ugh I better release this before someone steals it ........

Btw I made the script better,now there are two files:
1.configs.txt -- players can easily configurate ranks from this file
2.rank.lua

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
redefinder hat geschrieben
Homer hat geschrieben
I'm doing almost the exact same script as redefinder, but, It's for a RPG server.

ugh I better release this before someone steals it ........

Who's going to steal it?

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Flacko hat geschrieben
Ok, whatever, but don't forget that almost 65% of your script is written by me

yes I know

when I upload it,I will add credits

Script Authors:
Flacko
Blazzingxx
redefinder

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
I don't care about credits. I just want you to not to behave like a fag, because I think you didn't do good when you quoted Homer.

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Flacko hat geschrieben
I don't care about credits. I just want you to not to behave like a fag, because I think you didn't do good when you quoted Homer.

Nah I didn`t post that to offend him -.-

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
redefinder hat geschrieben
Script Authors:
Flacko
Blazzingxx
redefinder


Lol? I shouldn't be there, I only fixed a small mistake...

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Blazzingxx hat geschrieben
Lol? I shouldn't be there, I only fixed a small mistake...

you still helped.....and you didn`t just fix a bug you also helped me with several other things
1× editiert, zuletzt 15.01.10 23:39:46
Zum Anfang Vorherige 1 2137 138 139338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht