Forum

> > CS2D > Scripts > bot select knife when there are no enemies nearby
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch bot select knife when there are no enemies nearby

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt bot select knife when there are no enemies nearby

khaled1968
User Off Offline

Zitieren
Hi, I was trying to make bots select knife when there are no enemies nearby them, to make bots performance better ofc, so I used this code...

1
2
3
4
5
6
7
8
9
10
addhook("second","enemycheck")
function enemycheck()
for id=1,32 do
if player(id,"exists") and player(id,"bot") then
if ai_findtarget(id)==0 then
ai_selectweapon(id,50)
end
end
end
end

But the problem is that bots are putting knife ONLY in first time when they spawn, after that, if they faced an enemy they just put there weapons and never bring the knife back again! The code activate only for one time and idk why!
1× editiert, zuletzt 07.08.22 02:18:03

alt Re: bot select knife when there are no enemies nearby

LoaderFRA
User Off Offline

Zitieren
I use this in Standard IA.lua
1
2
3
4
5
if vai_mode[id]==0 then
		-- ############################################################ 0: IDLE -> decide what to do next
		vai_timer[id]=0; vai_smode[id]=0
		ai_selectweapon(id,50)
		fai_decide(id)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht