Rules FAQ Members List Search Register Login

 Raised This Month: \$ Target: \$400 0%

Author Message
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
 11-22-2023 , 21:22   [L4D2]Rotating Objects around player #1 Could anyone help me with the rotations of objects with speeds? I was trying to create a rotation scheme for the tank's rocks, in which they float around the tank, outlining it. There are eight rocks that keep rotating. PHP Code: ``` //Spawn Rocks             for(int i = 1; i <= 8; i++)         {             entity[i] = CreateEntityByName("prop_physics_override");             if(entity[i] != -1)             {                 char tName[64];                 Format(tName, sizeof(tName), "TSE%d", client);                 DispatchKeyValue(client, "targetname", tName);                 GetEntPropString(client, Prop_Data, "m_iName", tName, sizeof(tName));                                      SetEntityModel(entity[i], Model);                                  DispatchKeyValue(entity[i], "targetname", "FollowEntity");                 DispatchKeyValueVector(entity[i], "origin", vPos);                 DispatchKeyValueVector(entity[i], "Angles", vAng);                 DispatchKeyValue(entity[i], "parentname", tName);                 DispatchKeyValue(entity[i], "parentname", tName);                 DispatchKeyValue(entity[i], "solid", "0");                 AcceptEntityInput(entity[i], "TurnOn");                 DispatchSpawn(entity[i]);                                  followPosition[0] = followRadius * Cosine( DegToRad( followAngle )) + vPos[0];                 followPosition[1] = followRadius * Sine( DegToRad( followAngle )) + vPos[1];                 followPosition[2] = vPos[2];                              TeleportEntity(entity[i], followPosition, vAng, NULL_VECTOR);                                  followAngle    += incRadius;    // next point attachment             }                          SetEntityRenderColor(entity[i], sColor[0], sColor[1], sColor[2], sColor[3]);                      GlowTarget(entity[i], sGlow[0], sGlow[1], sGlow[2]);                      ClientModel[client][number][i-1] = EntIndexToEntRef(entity[i]);                      }                  DataPack hPack = new DataPack();         hPack.WriteCell(GetClientUserId(client));         hPack.WriteCell(number);         hPack.WriteFloat(Pos[2]);                  CreateTimer(0.01, TimerRotation, hPack, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); // //TimerRotaion Action TimerRotation(Handle timer, DataPack hPack) {     hPack.Reset();     int client = GetClientOfUserId(hPack.ReadCell());     if(!IsTank(client)) return Plugin_Stop;     int number = GetClientOfUserId(hPack.ReadCell());     int entity[9];     float vAng[9][3], vVel[9][3], vPos[3], NewPos, EntityPos[9][3];     GetClientAbsOrigin(client, vPos);     NewPos = hPack.ReadFloat();     vPos[2] += NewPos;     for(int i = 1; i <= 8; i++)     {         entity[i] = EntRefToEntIndex(ClientModel[client][number][i-1]);         if(!IsValidEntRef(entity[i])) continue;         if(!IsValidEntity(entity[i])) continue;                  GetEntPropVector(entity[i], Prop_Data, "m_vecOrigin", EntityPos[i]);         GetEntPropVector(entity[i], Prop_Data, "m_angRotation", vAng[i]);         GetEntPropVector(entity[i], Prop_Data, "m_vecVelocity", vVel[i]);                  if(vAng[i][1] >= 360.0) vAng[i][1] = 0.0;         else vAng[i][1] += 3.6;                  if ( EntityPos[i][2] < vPos[2] )         {             vAng[i][0] = -5.0;             GetAngleVectors( vAng[i], vVel[i], NULL_VECTOR, NULL_VECTOR);             NormalizeVector( vVel[i], vVel[i] );             vAng[i][0] = 0.0;         }         else if ( EntityPos[i][2] > ( vPos[2] + 45.0 ))         {             vAng[i][0] = 5.0;             GetAngleVectors( vAng[i], vVel[i], NULL_VECTOR, NULL_VECTOR);             NormalizeVector( vVel[i], vVel[i] );             vAng[i][0] = 0.0;         }         else         {             vAng[i][0] = 0.0;             GetAngleVectors( vAng[i], vVel[i], NULL_VECTOR, NULL_VECTOR);             NormalizeVector( vVel[i], vVel[i] );         }         ScaleVector(vVel[i], 90.0);         TeleportEntity( entity[i], NULL_VECTOR, vAng[i], vVel[i] );     }          return Plugin_Continue; } void GlowTarget(int entity, int R, int G, int B) {     SetEntProp(entity, Prop_Send, "m_glowColorOverride", R + (G * 256) + (B * 65536));     SetEntProp(entity, Prop_Send, "m_iGlowType", 3);     SetEntProp(entity, Prop_Send, "m_nGlowRange", 3000);     SetEntProp(entity, Prop_Send, "m_nGlowRangeMin", 0); }  ``` I don't know if is this correct __________________ My Noob Plugins Discord:WhiteFire#1301 Steam:WhiteFire Youtube Last edited by King_OXO; 11-27-2023 at 20:17.
XGAK
Junior Member
Join Date: May 2018
 11-22-2023 , 21:48   Re: [L4D2]Rotating Objects around player #2 use phys_torque to control the rotation. take a look at TF2 Rollermine spawner
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
 11-23-2023 , 07:27   Re: [L4D2]Rotating Objects around player #3 [l4d2] Luffy Items, by GsiX, has some rotating features, you may want to check. https://forums.alliedmods.net/attach...9&d=1352321672 __________________ Last edited by Marttt; 11-23-2023 at 07:28.
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
11-23-2023 , 17:59   Re: [L4D2]Rotating Objects around player
#4

Quote:
 Originally Posted by Marttt [l4d2] Luffy Items, by GsiX, has some rotating features, you may want to check. https://forums.alliedmods.net/attach...9&d=1352321672
Ty bro. you always help me
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire

Last edited by King_OXO; 11-23-2023 at 17:59.
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
11-27-2023 , 20:03   Re: [L4D2]Rotating Objects around player
#5

Quote:
 Originally Posted by Marttt [l4d2] Luffy Items, by GsiX, has some rotating features, you may want to check. https://forums.alliedmods.net/attach...9&d=1352321672
Bro, your answer worked, but now I have another problem. The particles are spawning wrong "info_particle_system (particle) has no particle system name specified!"( error particle, the one with several red "x"s) and entities are not attached correctly to the client:
"Entity prop_dynamic(prop_dynamic) has bad parent activator"
"ERROR: Tried to SetParentAttachment for entity prop_dynamic (prop_dynamic), but it has no parent."

I think the problem is in detecting the keys inside the tank_spawn_effects.cfg file and exploding the string
Attached Files
 tank_spawn_effects.cfg (2.6 KB, 37 views) Get Plugin or Get Source (l4d2_tank_spawn.sp - 58 views - 19.0 KB)
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire

Last edited by King_OXO; 11-29-2023 at 11:56.
Uncle Jessie
Member
Join Date: May 2016
Location: Mind Prison
11-28-2023 , 01:22   Re: [L4D2]Rotating Objects around player
#6

Quote:
 Originally Posted by King_OXO Bro, your answer worked, but now I have another problem. The particles are spawning wrong "info_particle_system (particle) has no particle system name specified!"( error particle, the one with several red "x"s) and entities are not attached correctly to the client: "Entity prop_dynamic(prop_dynamic) has bad parent activator" "ERROR: Tried to SetParentAttachment for entity prop_dynamic (prop_dynamic), but it has no parent." I'll put the plugin in the post for you to check I think the problem is in detecting the keys inside the tank_spawn_effects.cfg file and exploding the string
lol
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
11-29-2023 , 11:59   Re: [L4D2]Rotating Objects around player
#7

Quote:
 Originally Posted by Uncle Jessie lol
What do you mean by "lol"?
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Server Discussion     Source Servers (SRCDS)     HL1 Servers (HLDS) AMX Mod X     News     Bug Reports     General     Off-Topic     Plugins         Suggestions / Requests         Approved Plugins         New Plugin Submissions         Unapproved/Old Plugins         Translation Request         High-Traffic Plugins             GunGame             UAIO (Ultimate All-In-One Plugin)             xREDIRECT             CSDM             AMX Super             RuneMod             Zombie Plague Mod             SuperHero Mod                 News                 Tech Support                 Scripting Help                 Off-Topic / General Chat                 Heroes                     Suggestions / Requests                     Approved Heroes                     New Submissions                     Unapproved/Old Heroes                         Module Heroes                     SuperHero Mod Stats - By 123                 (OLD) Bug Reports     Scripting         Scripting Help         Code Snippets/Tutorials         Module Coding     Donor Access SourceMod     News     General     Plugins         Plugins         Unapproved Plugins         Plugin/Gameplay Ideas and Requests         High-Traffic Plugins             SourceMod Anti-Cheat             Zombie:Reloaded             SourceBans / SourceBans++             VSH / Freak Fortress             Store             SM_Hosties             HLstatsX:CE     Scripting     Extensions     Snippets and Tutorials     Donor Access     Metamod: Source         Metamod:Source Plugins         Metamod:Source Questions         Coding MM:S Plugins & SM Extensions Hosted Stuff     Asherkin's Plugins         TFDodgeball         TF2Items         SteamTools     Bail's Plugins         CSDM         CS:S DM Off-Topic & Trash     Off-Topic     Trash

All times are GMT -4. The time now is 02:22.

 DMCA - Archive - Top