AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Potti] AIM Angle of bot (https://forums.alliedmods.net/showthread.php?t=236378)

Phant 03-03-2014 16:57

[Potti] AIM Angle of bot
 
Hello. I want add respawn feature after death for Potti bot plugin.

I do:
PHP Code:

ExecuteHam(Ham_CS_RoundRespawnid)
engfunc(EngFunc_SetOriginidsaved_origin)
set_pev(idpev_anglessaved_angles);
set_pev(idpev_fixangle); 

Bot respawned, change its position, but don't change (restore) angles (last two strings: pev_angles, pev_fixangle).

Before death (saved position):
http://6.firepic.org/6/thumbs/2014-0...i82b9hu54c.jpg

After death and respawn (angles don't apply):
http://6.firepic.org/6/thumbs/2014-0...c3esd1h71e.jpg

How I can fix it?

georgik57 03-04-2014 09:26

Re: [Potti] AIM Angle of bot
 
Try setting the angles in ham_spawn_post, maybe that will do the trick.

Phant 03-04-2014 18:00

Re: [Potti] AIM Angle of bot
 
I already try to set angles in any time (by clientcmd) when bot alive (without respawning) — do not work.

Just code with angles like this:
PHP Code:

saved_angles[0] = random_float(0.0360.0)
saved_angles[1] = random_float(0.0360.0)
saved_angles[2] = random_float(0.0360.0)
        
set_pev(playerpev_anglessaved_angles)
set_pev(playerpev_fixangle1

Work with real player, but do not work with Potti bot :cry:.

ConnorMcLeod 03-05-2014 01:13

Re: [Potti] AIM Angle of bot
 
Have you tried to set v_angle to NULL vector at the same time ?

Phant 03-05-2014 05:28

Re: [Potti] AIM Angle of bot
 
Quote:

Originally Posted by ConnorMcLeod (Post 2107655)
Have you tried to set v_angle to NULL vector at the same time ?

I try like this (found by you in another topic):
PHP Code:

        saved_angles[0] = random_float(0.0360.0)
        
saved_angles[1] = random_float(0.0360.0)
        
saved_angles[2] = random_float(0.0360.0)
        
        
entity_set_vector(playerEV_VEC_v_angleFloat:{0.0,0.0,0.0});
        
entity_set_vector(playerEV_VEC_anglessaved_angles);
        
entity_set_int(playerEV_INT_fixangle1); 

Same (work for Player, but not for Potti bot) :(.

OFF:
Oh yes, you return your original avatar.

georgik57 03-05-2014 07:09

Re: [Potti] AIM Angle of bot
 
Quote:

Originally Posted by Phant (Post 2107690)
I try like this (found by you in another topic):
PHP Code:

        saved_angles[0] = random_float(0.0360.0)
        
saved_angles[1] = random_float(0.0360.0)
        
saved_angles[2] = random_float(0.0360.0)
        
        
entity_set_vector(playerEV_VEC_v_angleFloat:{0.0,0.0,0.0});
        
entity_set_vector(playerEV_VEC_anglessaved_angles);
        
entity_set_int(playerEV_INT_fixangle1); 

Same (work for Player, but not for Potti bot) :(.

OFF:
Oh yes, you return your original avatar.

Maybe you have to register them like the CZ Bots(RegisterHamFromEntity).

ConnorMcLeod 03-05-2014 15:04

Re: [Potti] AIM Angle of bot
 
Quote:

Originally Posted by georgik57 (Post 2107725)
Maybe you have to register them like the CZ Bots(RegisterHamFromEntity).

No, he tried also with a command.

georgik57 03-05-2014 15:39

Re: [Potti] AIM Angle of bot
 
Quote:

Originally Posted by ConnorMcLeod (Post 2107936)
No, he tried also with a command.

Oh, damn.

lazarev 03-06-2014 10:09

Re: [Potti] AIM Angle of bot
 
PHP Code:

public myCommand(id
    
botangles[id][1] = random_float(-180.0,180.0);

// in fm_cmdstart()

        
if(movement == && alive && button&IN_ATTACK) {
            static 
Float:target[3]
            
get_user_aim(id,target)
            
aim_at_origin(bot,target,angles)
        }
        else if( 
movement != ) { // !add this check!
            
get_uc(uc_handle,UC_ViewAnglesangles


repingayok 11-24-2015 15:39

Re: [Potti] AIM Angle of bot
 
Quote:

Originally Posted by lazarev (Post 2108267)
PHP Code:

public myCommand(id
    
botangles[id][1] = random_float(-180.0,180.0);

// in fm_cmdstart()

        
if(movement == && alive && button&IN_ATTACK) {
            static 
Float:target[3]
            
get_user_aim(id,target)
            
aim_at_origin(bot,target,angles)
        }
        else if( 
movement != ) { // !add this check!
            
get_uc(uc_handle,UC_ViewAnglesangles


I can't write AMXX plugins, who can help me and give FULL "potti.sma" with this code ?

P.S.: sorry for my bad english.


All times are GMT -4. The time now is 09:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.