English Anti-Bot score farm

4 replies
Goto Page
To the start Previous 1 Next To the start
16.02.18 02:51:14 am
Up
SkullFace
User
Offline Off
I've been trying that when you kill a bot, you don't get the score for killing that bot. So, that the usgn rank wouldn't be full of bot-spawn killer users and such.

This was my try. I honestly don't know what I'm doing here.

Code:
1
2
3
4
5
6
7
8
addhook("kill","noBotScoreFarm")
function noBotScoreFarm(killer,victim,weapon,x,y,killoid,assistant)
     local scoreSet = player(id,"score") - 1
     if player(id,"bot") == true then
     parse("setscore "..id.." "..scoreSet.." ")
     msg("works")
     end
end


I feel like I need to call the 'victim' parameter but don't know how to detect if its a bot or not.
IMG:https://i.imgur.com/kZBVkjM.gif
P.S. - I've been extracting recently enviromental sound files from other games, if anyone is interested in them for adding them to their maps, scripts, PM me
16.02.18 03:34:52 am
Up
Yu
User
Offline Off
The id value is nil in your script. Change victim to id on line 2 or use my script:
Code:
1
2
3
4
5
6
addhook("kill","kill_hook")
function kill_hook(killer, victim, weapon, x, y, object, assistant)
     if player(victim,"bot") then 
          parse("setscore "..killer.." "..(player(killer,"score") - 1))
     end
end
16.02.18 08:52:26 am
Up
Gaios
Security Supporter
Offline Off
I'm 99% sure that
score - 1
won't affect at server ranking. You should cs2d cmd customkill bot instead of changing player's score.
17.02.18 07:39:46 pm
Up
T-69
User
Offline Off
Hehe, you're too late. Many people have already played the awesome "grinder" map.
no u
18.02.18 06:59:41 pm
Up
SkullFace
User
Offline Off
After I've found some motivation to do this and time, here it is.
This time with customkill "X"

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
addhook("spawn","isBotSpawn")     
function isBotSpawn(id)

     if player(id,"bot") == true then
     parse ("setmoney "..id.." 16000")
     parse ("speedmod "..id.." -5")
     parse ("setarmor "..id.." 0")
     parse ("setmaxhealth "..id.." 250")
     parse ("equip "..id.." 4")
     parse ("equip "..id.." 24")
     end
end

addhook("hit","ifBotHealth")
function ifBotHealth(id)

     if player(id,"bot") == true then
     if player(id,"health") < 175 then
     parse("customkill 0 X "..id.." ")
     end
     end
end


I've set their hp to 250 so they don't die accidentally by a player.
IMG:https://i.imgur.com/kZBVkjM.gif
P.S. - I've been extracting recently enviromental sound files from other games, if anyone is interested in them for adding them to their maps, scripts, PM me
To the start Previous 1 Next To the start