Raised This Month: $ Target: $400
 0% 

[HELP] Rotating Entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 03-09-2017 , 01:44   [HELP] Rotating Entity
Reply With Quote #1

How to rotate entity on its center? when i'm changing its angles it changes also position.
Beqa Gurgenidze is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 03-09-2017 , 04:07   Re: [HELP] Rotating Entity
Reply With Quote #2

EV_VEC_avelocity or pev_avelocity
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 03-09-2017 , 04:19   Re: [HELP] Rotating Entity
Reply With Quote #3

Quote:
Originally Posted by georgik57 View Post
EV_VEC_avelocity or pev_avelocity
Does not seems to be working.
Beqa Gurgenidze is offline
Old 03-09-2017, 07:27
georgik57
This message has been deleted by georgik57.
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 03-10-2017 , 08:57   Re: [HELP] Rotating Entity
Reply With Quote #5

The engine seems to have a lot of requirements for avelocity one of them being that the entity must be thinking.
So it's easier for us to just do our own custom angle movement instead.

If you want and know how, you can fully convert the code to use Engine module's natives and forwards.
If you don't understand any part of the code, ask and I will answer. Have fun.

Code:
#include <amxmodx> #include <engine> #include <fakemeta> new const g_szModel[] = "models/chick.mdl"; new const g_szClassName[] = "MyCustomEntClassName"; const Float:g_fEntThinkFrequency = 0.001; public plugin_precache() {     precache_model(g_szModel) } public plugin_init() {     register_think(g_szClassName, "fwEgThinkEntCustom")         register_clcmd("say /entrot", "fwClCMDSay") } public fwEgThinkEntCustom(const iIDEnt) {     static Float:fVecTemp[3], Float:fVecTemp2[3];         pev(iIDEnt, pev_angles, fVecTemp2)     pev(iIDEnt, pev_vuser4, fVecTemp)         fVecTemp2[0] += (fVecTemp[0] * g_fEntThinkFrequency * 10);     fVecTemp2[1] += (fVecTemp[1] * g_fEntThinkFrequency * 10);     fVecTemp2[2] += (fVecTemp[2] * g_fEntThinkFrequency * 10);         set_pev(iIDEnt, pev_angles, fVecTemp2)     set_pev(iIDEnt, pev_nextthink, get_gametime() + g_fEntThinkFrequency) } public fwClCMDSay(const iID) {     static iIDAllocString;         if (!iIDAllocString)         iIDAllocString = engfunc(EngFunc_AllocString, "info_target");         new iIDEnt = engfunc(EngFunc_CreateNamedEntity, iIDAllocString);         if (!pev_valid(iIDEnt))         return;         set_pev(iIDEnt, pev_framerate, 1.0)         new Float:fGameTime = get_gametime();         set_pev(iIDEnt, pev_animtime, fGameTime)         dllfunc(DLLFunc_Spawn, iIDEnt)         set_pev(iIDEnt, pev_rendermode, kRenderNormal)     set_pev(iIDEnt, pev_renderfx, kRenderFxGlowShell)     set_pev(iIDEnt, pev_renderamt, 10.0)         static Float:fVecTemp[3];         fVecTemp[0] = random_float(50.0, 255.0);     fVecTemp[1] = random_float(0.0, 255.0);     fVecTemp[2] = random_float(0.0, 255.0);         set_pev(iIDEnt, pev_rendercolor, fVecTemp)         fVecTemp[0] = 0.0; // forward or backward rolling     fVecTemp[1] = random_num(0, 1) ? 50.0 : -50.0; //random_float(-50.0, 50.0) sideways turning     fVecTemp[2] = 0.0; // sideways rolling         set_pev(iIDEnt, pev_vuser4, fVecTemp)//pev_avelocity         pev(iID, pev_origin, fVecTemp)         fVecTemp[2] += 100.0;         engfunc(EngFunc_SetOrigin, iIDEnt, fVecTemp)     engfunc(EngFunc_SetModel, iIDEnt, g_szModel)     engfunc(EngFunc_SetSize, iIDEnt, Float:{ -5.0, -5.0, -5.0 }, Float:{ 5.0, 5.0, 5.0 })         set_pev(iIDEnt, pev_solid, SOLID_BBOX)//SOLID_TRIGGER SOLID_BSP SOLID_SLIDEBOX     set_pev(iIDEnt, pev_movetype, MOVETYPE_TOSS)//MOVETYPE_FLY MOVETYPE_PUSH         set_pev(iIDEnt, pev_classname, g_szClassName)     set_pev(iIDEnt, pev_nextthink, fGameTime)     //dllfunc(DLLFunc_Think, iIDEnt)         set_task(10.0, "fwTaskEntRemove", iIDEnt) } public fwTaskEntRemove(const iIDEnt) {     if (!pev_valid(iIDEnt))         return;         engfunc(EngFunc_RemoveEntity, iIDEnt) }
Attached Files
File Type: sma Get Plugin or Get Source (D7TestEntityRotate.sma - 538 views - 2.6 KB)
__________________

Last edited by georgik57; 03-10-2017 at 08:58.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Reply



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 17:55.


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