PDA

View Full Version : aimbot


xamp
17th March 2007, 15:31
Hi,
today a try nwe mod for ma server and I search bots for cod2.
I found http://callofduty.filefront.com/file/Squad_ukr_Bot_AI_Mod;57917
i try this mod , and bot still shoot to HEAD.I saw on source
(i am not coder :ninja: ) i think this in C++
------------------------------------------
there is code
botAim()
{
self.closestplayer = self;
enemyeye = self getEye();
self.eye = self getEye();
spray0 = 0;
spray1 = 0;
// vertical = 0;
horizontal = 0;
depth = 0;
i=0;

for(;;)
{
if(self.sessionstate == "dead")
{
//level thread removeBotWeapons(self.botsweapon + "_bot_close_mp");
//level thread removeBotWeapons(self.botsweapon + "_bot_far_mp");
self.movement = 0;
self waittill("spawned_player");
self takeallweapons();
}

enemyplayers = [];

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(player******.sessionstate == "spectator" || player******.sessionstate == "dead" || player****** == self || player******.pers["team"] == self.pers["team"])
continue;
else
{
enemyplayers[enemyplayers.size] = player******;
}
}

if(i==0)
{
depth = 0;
horizontal = 0;
// vertical = 15;
}
else if(i==1)
{
depth = -15;
horizontal = 15;
// vertical = 0;
}
else if(i==2)
{
horizontal = -15;
}
else if(i==3)
{
horizontal = 15;
depth = 15;
}
else if(i==4)
{
horizontal = -15;
i = -1;
}


for(i=0; i< enemyplayers.size; i++)
{
self.closestdist = 33554432;
self.closestplayer = self;
enemyeye = enemyplayer****** getEye() + (0,0,15);
self.eye = self getEye() + (horizontal,depth,15);

dist = (distance(self.origin, enemyplayer******.origin));
trace = bullettrace(self.eye, enemyeye, false, undefined);

if(dist < self.closestdist && trace["surfacetype"]=="none")
{
self.closestplayer = enemyplayer******;
self.closestdist = dist;
}
}
if(self.closestplayer != self)
{
if(self.closestdist < 600)
{
changeWeapon(self.botsweapon + "_bot_close_mp");
self.movement = 2;
}
else
{
changeWeapon(self.botsweapon + "_bot_far_mp");
self.movement = 3;
}

if(!isdefined(self.closestplayer.ex_eyemarker) && isdefined(self.closestplayer))
{
//self.ex_eyemarker unlink();
//self.ex_eyemarker delete();
self.closestplayer.ex_eyemarker = spawn("script_origin",(0,0,0));
self.closestplayer.ex_eyemarker linkto (self.closestplayer, "tag_eye",(0,0,0),(0,0,0));
}

//self.aimfor = randomInt(2); //aim for head or body

for(i=0; i<6; i++)
{
if(self.closestdist < 600)
{
spray0 = randomInt(20)-10;
spray1 = randomInt(20)-10;
}
else
{
spray0 = 0;
spray1 = 0;
}
wait level.botsskill/3;
self.eye = self getEye();
target_direction = vectorNormalize( ( self.closestplayer.ex_eyemarker.origin[0] - self.eye[0] + spray0, self.closestplayer.ex_eyemarker.origin[1] - self.eye[1] +spray1, self.closestplayer.ex_eyemarker.origin[2] - self.eye[2] - 20)); // - (self.closestplayer getEye()[2] - self.closestplayer.origin[2])/2*self.aimfor) );
self setPlayerAngles(vectorToAngles( target_direction ));
}
}
else
{
self takeallweapons();
self.movement = 6;
}

wait level.botsskill;
i++;
}
}

how to coding this for COD2 1.0 for player,not for bots

Thx

BlackDove
17th March 2007, 16:26
Good idea you have there, I've tried it before...

Yes, it's similiar to the C++ language. It's the CoD 2 scripting language and the code you posted is the aiming function for multiplayer bots.

These bots are not aimbots, they are computer opponents that can be added through the use of the mod that includes this code.

Assuming that it could be programmed to perfect your aiming, you would have to bypass the pure server check in order to use the mod on normal servers.

You may want to look at some CoD 2 scripting / developer sites. Try iwnation.com's forums as a start.

Let us know if you get anywhere with the code.

xamp
17th March 2007, 18:57
Good idea you have there, I've tried it before...

Yes, it's similiar to the C++ language. It's the CoD 2 scripting language and the code you posted is the aiming function for multiplayer bots.

These bots are not aimbots, they are computer opponents that can be added through the use of the mod that includes this code.

Assuming that it could be programmed to perfect your aiming, you would have to bypass the pure server check in order to use the mod on normal servers.

You may want to look at some CoD 2 scripting / developer sites. Try iwnation.com's forums as a start.

Let us know if you get anywhere with the code.

i like to report any words about this source , but i coding in C++ meybe 2mounths :dead: , i think this code rewrite to opengl or d3d ? --> this hard for me (i learnt nehe --> czech tutorial for opengl ;) )

--------------------------------
xampik

BlackDove
17th March 2007, 21:58
That code is not D3D or OpenGL. If you are trying to code a hack that has both engine functions (like in the example code above) and OpenGL functions, write a client hook. With two months of coding, this probably isn't a possibility for you yet.

xamp
17th March 2007, 22:47
That code is not D3D or OpenGL. If you are trying to code a hack that has both engine functions (like in the example code above) and OpenGL functions, write a client hook. With two months of coding, this probably isn't a possibility for you yet.


hi, yes , i post this code for better coder then me , (is there another user who rewrite this code for all (free aimbot without spammer message etc.) ?=) =)

Xampik