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 2325 326 327338 339 Nächste Zum Anfang

alt @Fonduta

Rainoth
Moderator Off Offline

Zitieren
Look in cs2d file archive. If you did not find it then PM me.

alt Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Zitieren
BureX hat geschrieben
Help please.

Is it possible for multiple "ai_goto" ?

Like every single bot goes to single "ai_goto".

P.S. Can somebody explain me how to use "ai_goto" ? (Not necessary)


Please ?

alt Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Zitieren
BureX hat geschrieben
BureX hat geschrieben
Help please.

Is it possible for multiple "ai_goto" ?

Like every single bot goes to single "ai_goto".

P.S. Can somebody explain me how to use "ai_goto" ? (Not necessary)


Please ?


Read info.txt about bot functions. In case you didnt find it, here's a quote from the file:
info.txt hat geschrieben
- ai_goto(id,x,y,[walk])     Bot goes to tile (x|y). Set walk to 1 to let it walk (silent)
                    Returns 0 when failed to find path, 1 when target is reached or
                    2 when bot is still on its way.


First you have to check whether the player is bot or not, you can do it by player(id,"bot") command. Then if this person is a bot you can put ai_goto(id,x,y) where x and y - position of the tile to go to. Depending on id different bot can go to different position.

alt Re: Lua Scripts/Questions/Help

Smuckie
User Off Offline

Zitieren
batlaizys hat geschrieben
Look in cs2d file archive. If you did not find it then PM me.


I found it. I want to use it with another LUA script. Do I make a folder, put them both in, and type in the name in options?

alt Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Zitieren
no just put them in cs2d/sys/lua then look a file called server.lua the write there the following line :
1
dofile("sys/lua/NAME OF THE FILE.lua")

alt Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Zitieren
BureX meant that he wants multiple bots to be hooked to one ai_goto. Stop appointing everybody to info.txt.

It can be done with a for expression, but only if you select few bots with ids like 1,2,3,4,5 in this very order:
1
2
3
for id=1,5 do
	ai_goto(id,lolwut,lolwut)
end
Lolwut as coordinates.
It will be more complicated if the server has mixed bots and players.

alt Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Zitieren
Glock Pwner that doesnt work that easy you have to edit the bot script to make all bots got there otherwise they will ignore ai_goto because the have a other note to go

alt Re: Lua Scripts/Questions/Help

PAlllUCH
User Off Offline

Zitieren
Hi,
I have a small reques.
When Ct Player dies, he goes to the TT and can't go back to the CT, And when the number of Ct will be 0, the game will be restart, and after restart everybody go to CT, but bots are in TT.

alt Re: Lua Scripts/Questions/Help

Kurumi
User Off Offline

Zitieren
PAlllUCH hat geschrieben
Hi,
I have a small reques.
When Ct Player dies, he goes to the TT and can't go back to the CT, And when the number of Ct will be 0, the game will be restart, and after restart everybody go to CT, but bots are in TT.
search in zombie plague

alt Re: Lua Scripts/Questions/Help

iii
User Off Offline

Zitieren
I have 2 ideas.
First: when you drop your weopon you can't be wounded (for chat etc.) If you take your weapon again you can attack again and after 15 sec you get your weapon so or per lua.
Second: If you press a key you see a list with all now playing players and their US nick, ther rank and maybe language or country where they play.
If someone made this he can public it here and i think many would be happy

alt Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Zitieren
PAlllUCH hat geschrieben
Hi,
I have a small reques.
When Ct Player dies, he goes to the TT and can't go back to the CT, And when the number of Ct will be 0, the game will be restart, and after restart everybody go to CT, but bots are in TT.


This is from a rough version. You gotta test it and write me a PM if there are any bugs (i'll fix them). I didnt test it with many players, but it should work(add this to "server.lua" file):
Spoiler >

alt Re: Lua Scripts/Questions/Help

J4x
User Off Offline

Zitieren
Hi everyone i like to know if its necessary to add a hook to the scripts? because i have seen script without hooks here is an example :
1
2
3
4
5
6
7
8
function main(id)
msg2 (id,"©000255255you sniffed a nose of cocaine")
timer(100,"flash",id,20)
end

function flash(id)
parse ("flashplayer "..id.." 5")
end

P.D: Script is not mine so dont copy/ or use this code!
1× editiert, zuletzt 13.12.10 23:55:43

alt Re: Lua Scripts/Questions/Help

Chex
User Off Offline

Zitieren
Those are mostly functions to be called upon in other functions, either with a timer or just straight up. It conserves space and makes the code run smoother.

alt Re: Lua Scripts/Questions/Help

JONY
User Off Offline

Zitieren
FN_Nemesis hat geschrieben
Hi everyone i like to know if its necessary to add a hook to the scripts? because i have seen script without hooks here is an example :
1
2
3
4
5
6
7
8
function main(id)
msg2 (id,"©000255255you sniffed a nose of cocaine")
timer(100,"flash",id,20)
end

function flash(id)
parse ("flashplayer "..id.." 5")
end

P.D: Script is not mine so dont copy/ or use this code!


When do you want these functions to be called? When player joins/every minute/when player says something. You need a hook(-s) anyway...

You dont need a hook when you want something to be done when server starts, for example parse("mp_friendlyfire 0") to disable friendly fire - for that you dont need a hook.
J.

alt Re: Lua Scripts/Questions/Help

Jake-rus
User Off Offline

Zitieren
why bots with my lua are freeze ??? this is OMG
1
2
LUA ERROR (ai_update_living): bots/includes/collect.lua:16: attempt to call global 'item' (a table value)
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!

alt Re: Lua Scripts/Questions/Help

Surplus
User Off Offline

Zitieren
Jake-rus hat geschrieben
1
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!


mhm... its so hard to write "bot_freeze 0" in console like it sayed

alt Re: Lua Scripts/Questions/Help

welerson001
BANNED Off Offline

Zitieren
Jake-rus hat geschrieben
why bots with my lua are freeze ??? this is OMG
1
2
LUA ERROR (ai_update_living): bots/includes/collect.lua:16: attempt to call global 'item' (a table value)
Freezing bots to stop Lua error msg flood! Use 'bot_freeze 0' to unfreeze bots!

alt Re: Lua Scripts/Questions/Help

J3sse
User Off Offline

Zitieren
Noob question: Is it OK to use a lua script in the first page that gives you 16k on respawn? If it is, where should i put it? :S
Zum Anfang Vorherige 1 2325 326 327338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht