Forum
Scripts
Lua Scripts/Questions/Help Skipper has written
Maybe he should say what he removed from the script? Btw. pack the script in a spoiler. Please. That's nearly spam when it's that big to scroll a half minute to top of the screen...
I totally agree!
...And good idea (: I had never thought of that
If i say !NOFOG, then all players will see on map? or only i?
pls tell.
DRoNe has written
Anders4000 i have question for that fog code.
If i say !NOFOG, then all players will see on map? or only i?
pls tell.
If i say !NOFOG, then all players will see on map? or only i?
pls tell.

I'm sorry. But the fog will change for all!
If you set it to off -> There wouldn't be any fog (For all)
If you set it to on -> There would be fog for all.
It is not enabled to let 1 player have no fog, and the others have.
So the answer to your question is: All players will se on map (:
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
--[[
Made by the Unrealsoftware.de User "Heavy"
Rule no 1: Do what ever you want with this script. But dont claim this as your own!
» Changelog:
[ADDED] disabling/enabling money
[FIXED] mines didn't work
[FIXED] building sometimes didn't work (if this still doesn't work ,try disabling other buildingluascripts)
[FIXED] you weren't able to see whose building it is/was
[CHANGED] code cleaned up a bit
ENABLE/DISABLE Stuff (Note: 1 means enabled and 0 means disabled ]]
fastbuild=1
unlimitedbuild=1
money=0
-- FastBuild:
addhook("build","fb")
function fb(id,type,x,y)
		function spawnobject()
			parse("spawnobject "..type.." "..x.." "..y.." 0 0 "..player(id,"team").." "..id);
		end
		function checkmoney(mmoney)
			if(money==1) then
				parse("setmoney "..id.." "..player(id,"money")-mmoney);
			end
		end
if (fastbuild==1) then
			if(type==1) and (player(id,"money")>=300) then
				spawnobject()
				checkmoney(300)
			elseif(type==2) and (player(id,"money")>=500) then
				spawnobject()
				checkmoney(500)
			elseif(type==3) and (player(id,"money")>=1000) then
				spawnobject()
				checkmoney(1000)
			elseif(type==4) and (player(id,"money")>=2000) then
				spawnobject()
				checkmoney(2000)
			elseif(type==5) and (player(id,"money")>=3000) then
				spawnobject()
				checkmoney(3000)
			elseif(type==6) and (player(id,"money")>=1500) then
				spawnobject()
				checkmoney(1500)
			elseif(type==7) and (player(id,"money")>=5000) then
				spawnobject()
				checkmoney(5000)
			elseif(type==8) and (player(id,"money")>=5000) then
				spawnobject()
				checkmoney(5000)
			elseif(type==9) and (player(id,"money")>=5000) then
				spawnobject()
				checkmoney(5000)
			elseif(type==13) and (player(id,"money")>=3000) then
				spawnobject()
				checkmoney(3000)
			elseif(type==14) and (player(id,"money")>=3000) then
				spawnobject()
				checkmoney(5000)
			elseif(type==20) then -- Mines...
				spawnobject()
			end
return 1
		else
			return 0
end
end
-- UnlimitedBuild:
if (unlimitedbuild==1) then
parse('mp_building_limit "Barricade" 10000');
parse('mp_building_limit "Barbed Wire" 10000');
parse('mp_building_limit "Wall I" 10000');
parse('mp_building_limit "Wall II" 10000');
parse('mp_building_limit "Wall III" 10000');
parse('mp_building_limit "Gate Field" 10000');
parse('mp_building_limit "Turret" 10000');
parse('mp_building_limit "Dispenser" 10000');
parse('mp_building_limit "Supply" 10000');
parse('mp_building_limit "Teleporter Entrance" 10000');
parse('mp_building_limit "Teleporter Exit" 10000');
end
Error: it says "unexpected string on line 4):
I think you should try to close Lua comment with this:
1
--]]
Too bad, I can't test it right now.
edited 1×, last 30.01.10 10:33:36 pm
Like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
--[[ Made by the Unrealsoftware.de User "Heavy" Rule no 1: Do what ever you want with this script. But dont claim this as your own! » Changelog: [ADDED] disabling/enabling money [FIXED] mines didn't work [FIXED] building sometimes didn't work (if this still doesn't work ,try disabling other buildingluascripts) [FIXED] you weren't able to see whose building it is/was [CHANGED] code cleaned up a bit ENABLE/DISABLE Stuff (Note: 1 means enabled and 0 means disabled ]]--
Anders4000 has written
Are you sure it has o be a "--]]"? i think it shall be "]]--" (:
All Lua string type blocks are closed off by ]], therefore it doesn't really matter if it's --]] or]]--. For Consistency however, use --]] as the statements after ]] are still evaluated. For example
print(--[[OMG]]":D") is a valid expression.
You should make a table of buildings money thought.
In that case, you could change many ifs.
But I guess you know that already...
If it's not working, you shouldn't be mad or upset anyway.
I don't get most of people here, why don't they try to make it first instead of asking all the time same questions?
edited 1×, last 31.01.10 02:10:28 am
EDIT: Never Mind, Sorry guys, I had to trick the script, I fixed it now
Weird though, I had to make it instead of ~= I had to use if not. To get it to print both value's.And, Another question, should ~= say that if it is not equal to the specified value then it returns true?
edited 2×, last 31.01.10 03:30:43 am
== - Equal
>= - Greater or equal
<= - Lower or equal
leegao has written
All Lua string type blocks are closed off by ]], therefore it doesn't really matter if it's --]] or]]--. For Consistency however, use --]] as the statements after ]] are still evaluated. For example
print(--[[OMG]]":D") is a valid expression.
Anders4000 has written
Are you sure it has o be a "--]]"? i think it shall be "]]--" (:
All Lua string type blocks are closed off by ]], therefore it doesn't really matter if it's --]] or]]--. For Consistency however, use --]] as the statements after ]] are still evaluated. For example
print(--[[OMG]]":D") is a valid expression.
Hm.. (:
------------------------------------
Blazzingxx has written
~= - Not equal
== - Equal
>= - Greater or equal
<= - Lower or equal
== - Equal
>= - Greater or equal
<= - Lower or equal
Thanks for that!
- Very useful (:
Homer has written
@flacko Your script isn't working, Only reading one of the table values. I copiied it exactly and tried and it still didn't work.
You were suppossed to read what I wrote, not the script.
I just tabbed your script and you would fix it using my suggestion:
Me has written
Your problem is that you return 1 if the first item in the table isn't equal to your USGN, returning cuts the execution of a function.
So you might want to move the return 1 right before the last end. This way it will only return 1 if the USGN hasn't been found in your table after your loop.
So you might want to move the return 1 right before the last end. This way it will only return 1 if the USGN hasn't been found in your table after your loop.
But, It might be the player(id,"usgn") thingy, since I don't know for sure, but when I print it, it returns 2 value's of the persons usgn. And it only return the first value 2 times. Could that be it? And if so.. how could I fix it, if your suggestion fixed only the comparision of the equal?
edited 2×, last 31.01.10 10:43:41 pm
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook("team","Team1")
function Team1(id,team)
for index, value in ipairs(ADMINS.S) do
if (team == 1) then
		 print(player(id,"usgn"))
if (player(id,"usgn") == value) then
end
end
end
	return 0
end
Lua Scripts/Questions/Help


Offline