English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 187 188 189 ... 338 339 Next To the start
11.04.10 12:27:35 pm
Up
DRoNe
User
Offline Off
I think it's impossible.
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
11.04.10 12:30:38 pm
Up
DC
Admin
Offline Off
you can make your own money variable in Lua for "virtual" money. when the real money becomes low and if there still is virtual money in your variable, you decrease the virtual money by amount X and increase the real money by the same amount.

however this is a dirty solution and the money display will always display a maximum of 16000$. you can't change this limit.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
11.04.10 04:39:55 pm
Up
Patasuss
User
Offline Off
Or like in [CC] Roleplay!
The "real" money is 0 everytime.
Only "virtual" money is used.
It's showed by a hudtxt over the normal money.
Portal
12.04.10 10:09:29 am
Up
Dictatus Papae
User
Offline Off
Will anyone ever answer me?
12.04.10 03:31:28 pm
Up
asasin
User
Offline Off
How to make Lua Scripts???
12.04.10 06:49:48 pm
Up
Tenaika
User
Offline Off
Go to your CS2D folder then go to 'sys' then to 'lua' folder and open server.lua. Then if you want to start a totally new script, delete everything in there and write your lua code.

P.S. Yes, you need to know lua to script. Duh.
Nothing to see here, move along.
12.04.10 06:57:25 pm
Up
ohaz
User
Offline Off
https://ohaz.engineer - Software Engineering
12.04.10 08:08:24 pm
Up
Soja1997
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
addhook("kill","RIP")
function RIP(id)
     if (player(id,"money")>5999) then
          parse("setmoney "..id.." "..player(id,"money")-6000)
          freeimage(id)
          id1=image("gfx/RIP.bmp",1,1,200+id) 
          imagecolor(id1,255,255,255)                              
          imageblend(id1,0)                                        
          imagealpha(id1,0.5)     
     end
     end

for what when I am dying isn't erecting the gravestone
13.04.10 12:52:40 am
Up
Ruirize
User
Offline Off
You're applying it to a dead player. Fail.
13.04.10 01:04:50 am
Up
Flacko
User
Offline Off
Ruirize has written:
You're applying it to a dead player. Fail.

Lol? That's not what's wrong.
I won't fix it for you but:
•You should use 'die' hook, specially because it has x and y parameters.
•You should use an array to store images' ids.
•You should use imagepos.
•You shouldn't copy DC's glowing players example.
•You should learn lua so you understand what you are doing.
13.04.10 06:48:06 am
Up
saladface27
User
Offline Off
Is there any way to execute a ini file as part of a script? (ie for settings etc)
an example would be
givewrench=0
splitteams=1
in the ini file.

Also how could you select a random player from a specific team?
13.04.10 07:12:05 am
Up
Sleepin
User
Offline Off
You dont need a .ini file,just use a .txt file for settings.

And I dont know the other one,prehaps math.random?
IMG:http://www.avatarsdb.com/avatars/gatling_gun.gif
Gattling Gun
13.04.10 07:15:37 am
Up
ohaz
User
Offline Off
you would need to create a table with all the players of one team, then use math.randomseed(os.clock()) and math.random(table#)
https://ohaz.engineer - Software Engineering
13.04.10 01:44:12 pm
Up
saladface27
User
Offline Off
@banana200000
what code would i need to execute the file
perhaps something like
file = assert(io.open("sys/lua/...
but after that i'm not sure
13.04.10 02:03:00 pm
Up
goweiwen
User
Offline Off
May I know if there is a hook for destroying buildings?

edit:
@saladface27
dofile('sys/lua/...')
edited 1×, last 13.04.10 02:25:37 pm
13.04.10 02:53:37 pm
Up
Vectarrio
User
Offline Off
weiwen has written:
May I know if there is a hook for destroying buildings?

I see only this in info txt:
break(x,y)                              on breaking a breakable entity
-x: breakable x (tiles)
-y: breakable y (tiles)
13.04.10 03:47:45 pm
Up
Patasuss
User
Offline Off
I think break(x,y) is for the breakables from Editor.
Portal
13.04.10 03:58:36 pm
Up
Vectarrio
User
Offline Off
Patasuss has written:
I think break(x,y) is for the breakables from Editor.

Exactly, but maybe it will fit to destroying buildings...
13.04.10 04:02:51 pm
Up
goweiwen
User
Offline Off
I thought so too, but it doesn't work. It's only for breakable entities.
13.04.10 04:11:57 pm
Up
Patasuss
User
Offline Off
I want to make that a player1 cannot destroy a building of player2 (both in same team). But that player2 can destroy his own building?
How could i do that?
Portal
To the start Previous 1 2 ... 187 188 189 ... 338 339 Next To the start