Raised This Month: $12 Target: $400
 3% 

[Potti] AIM Angle of bot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 03-03-2014 , 16:57   [Potti] AIM Angle of bot
Reply With Quote #1

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):


After death and respawn (angles don't apply):


How I can fix it?
Phant is online now
Send a message via ICQ to Phant
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 03-04-2014 , 09:26   Re: [Potti] AIM Angle of bot
Reply With Quote #2

Try setting the angles in ham_spawn_post, maybe that will do the trick.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 03-04-2014 , 18:00   Re: [Potti] AIM Angle of bot
Reply With Quote #3

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 .
Phant is online now
Send a message via ICQ to Phant
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2014 , 01:13   Re: [Potti] AIM Angle of bot
Reply With Quote #4

Have you tried to set v_angle to NULL vector at the same time ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 03-05-2014 , 05:28   Re: [Potti] AIM Angle of bot
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
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.

Last edited by Phant; 03-05-2014 at 05:29.
Phant is online now
Send a message via ICQ to Phant
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 03-05-2014 , 07:09   Re: [Potti] AIM Angle of bot
Reply With Quote #6

Quote:
Originally Posted by Phant View Post
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).
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2014 , 15:04   Re: [Potti] AIM Angle of bot
Reply With Quote #7

Quote:
Originally Posted by georgik57 View Post
Maybe you have to register them like the CZ Bots(RegisterHamFromEntity).
No, he tried also with a command.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 03-05-2014 , 15:39   Re: [Potti] AIM Angle of bot
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
No, he tried also with a command.
Oh, damn.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-06-2014 , 10:09   Re: [Potti] AIM Angle of bot
Reply With Quote #9

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

Last edited by lazarev; 03-06-2014 at 10:09.
lazarev is offline
repingayok
Senior Member
Join Date: Sep 2008
Old 11-24-2015 , 15:39   Re: [Potti] AIM Angle of bot
Reply With Quote #10

Quote:
Originally Posted by lazarev View Post
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.
repingayok is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:56.


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