AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Setting origin with set_pev vs set_user_origin (https://forums.alliedmods.net/showthread.php?t=85017)

Bugsy 02-04-2009 11:24

Setting origin with set_pev vs set_user_origin
 
PHP Code:

set_user_origing_BotID fVictimOrigin )

set_pev g_BotIDpev_origin fVictimOrigin 

I tried using both in my aimbot detection plugin but when I use set_pev, the bot is unable to be shot once I set the origin. Ham_TakeDamage never gets called when I shoot it.

When I use set_user_origin, it functions properly and takedamage gets called when shot. Is there something else I need to call after the set_pev?

ConnorMcLeod 02-04-2009 12:18

Re: Setting origin with set_pev vs set_user_origin
 
Look at fm_set_user_origin in fakemeta_util.inc

Dores 02-04-2009 12:19

Re: Setting origin with set_pev vs set_user_origin
 
-Removed- Connor is faster.

Also, isn't the origin parameter of set_user_origin an Integer?

Bugsy 02-04-2009 21:36

Re: Setting origin with set_pev vs set_user_origin
 
Quote:

Originally Posted by Dores (Post 755620)
-Removed- Connor is faster.

Also, isn't the origin parameter of set_user_origin an Integer?

ConnorMcLeod: I will try it, thanks.

Dores: Oops yes it is. I posted that for just this thread, in the actual code it is an integer. I am using other functions that require the origin to be a float so I am changing all of the get\set origins to floats as well.

Bugsy 02-05-2009 00:37

Re: Setting origin with set_pev vs set_user_origin
 
fm_set_user_origin requires an int origin param.
fm_set_user_origin( id , param )

Per fakemeta_util.inc, the above function converts the origin to a float and then calls fm_entity_set_origin( id , float:origin ). I am using the fm_entity_set_origin call directly and it is working :) +karma


All times are GMT -4. The time now is 01:42.

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