You are viewing our Forum Archives. To view or take place in current topics click here.
#11. Posted:
ISIS
  • Resident Elite
Status: Offline
Joined: Sep 11, 20149Year Member
Posts: 268
Reputation Power: 14
Status: Offline
Joined: Sep 11, 20149Year Member
Posts: 268
Reputation Power: 14
XeSao wrote
Orbs wrote
AnimeHypedUp wrote
Orbs wrote
AnimeHypedUp wrote Lol this is a really bad way of doing it just saying.

it might be a bad way of doing it but its still a way / only way that is released that i could find/
Why aren't you using G_EffectIndex for the effects rather than using all those if statements?

i didn't think about using it :/ its on the post now though


You should use G_EffectIndex as it is much easier then finding the id's for all of the effects.

I actually wrote a ShootFx function yesterday.

It's pretty short
If you want you can use it.

void shootEffect(int client, char *effect)
{
   playFX(effect, GetCursorPosition(client));
}


then for GetCursorPosition:
float *GetCursorPosition(int client)
{
   BulletTraceType Type;
   bulletTrace(&Type, getTagOrigin(client, "tag_eye"), vector_scale(anglesToForward(getPlayerAngles(client)), 1000000), client, 0);
   return Type.position;
}

Im using my own bulletTrace but you can use yours as both should work

if you dont have vector_scale:
float *vector_scale(float *vec, float scale)
{
   float out[3];
   for(int i = 0;i < 3;i++)
      out[i] = (vec[i] * scale);
   return out;
}


and anglesToForward
void (*AngleVectors)(const float *angles, float *forward, float *right, float *up) =
   (void(*)(const float *, float *, float *, float *))0x8228EDC0;
float *anglesToForward(float *angles)
{
   float forward[3];
   AngleVectors(angles, forward, 0, 0);
   return forward;
}


and if you dont have getPlayerAngles:
float *getPlayerAngles(int client)
{
   return (float *)(playerState(client) + 0x10C);
}


Everything worked when i tested it yesterday
So have fun with it
Actually this is GetPlayerAngles


float* GetPlayerAngles(){
     return (float*)(Entity() + 0x48);
}
EDIT: You should release your bullettrace because this isn't working with james's
#12. Posted:
XeSao
  • New Member
Status: Offline
Joined: Aug 13, 20149Year Member
Posts: 8
Reputation Power: 0
Status: Offline
Joined: Aug 13, 20149Year Member
Posts: 8
Reputation Power: 0
AnimeHypedUp wrote
XeSao wrote
Orbs wrote
AnimeHypedUp wrote
Orbs wrote
AnimeHypedUp wrote Lol this is a really bad way of doing it just saying.

it might be a bad way of doing it but its still a way / only way that is released that i could find/
Why aren't you using G_EffectIndex for the effects rather than using all those if statements?

i didn't think about using it :/ its on the post now though


You should use G_EffectIndex as it is much easier then finding the id's for all of the effects.

I actually wrote a ShootFx function yesterday.

It's pretty short
If you want you can use it.

void shootEffect(int client, char *effect)
{
   playFX(effect, GetCursorPosition(client));
}


then for GetCursorPosition:
float *GetCursorPosition(int client)
{
   BulletTraceType Type;
   bulletTrace(&Type, getTagOrigin(client, "tag_eye"), vector_scale(anglesToForward(getPlayerAngles(client)), 1000000), client, 0);
   return Type.position;
}

Im using my own bulletTrace but you can use yours as both should work

if you dont have vector_scale:
float *vector_scale(float *vec, float scale)
{
   float out[3];
   for(int i = 0;i < 3;i++)
      out[i] = (vec[i] * scale);
   return out;
}


and anglesToForward
void (*AngleVectors)(const float *angles, float *forward, float *right, float *up) =
   (void(*)(const float *, float *, float *, float *))0x8228EDC0;
float *anglesToForward(float *angles)
{
   float forward[3];
   AngleVectors(angles, forward, 0, 0);
   return forward;
}


and if you dont have getPlayerAngles:
float *getPlayerAngles(int client)
{
   return (float *)(playerState(client) + 0x10C);
}


Everything worked when i tested it yesterday
So have fun with it
Actually this is GetPlayerAngles


float* GetPlayerAngles(){
     return (float*)(Entity() + 0x48);
}
EDIT: You should release your bullettrace because this isn't working with james's


gEnt + 0x48 are the angles you can set and read from.
I'm using ps + 0x10C because it's used in PlayerCmd_getPlayerAngles.
It's up to you which one you want to use.
I'm just using getPlayerAngles because they used it at Tu6

P.S.: I'm adding bulletTrace later - ( 0x821D6018 - Offset for PlayerCmd_getPlayerAngles if you want to look into that )

Edit: paste bin. com/eSxdnP0F - That's my bulletTrace


Last edited by XeSao ; edited 4 times in total
#13. Posted:
ISIS
  • Resident Elite
Status: Offline
Joined: Sep 11, 20149Year Member
Posts: 268
Reputation Power: 14
Status: Offline
Joined: Sep 11, 20149Year Member
Posts: 268
Reputation Power: 14
XeSao wrote
AnimeHypedUp wrote
XeSao wrote
Orbs wrote
AnimeHypedUp wrote
Orbs wrote
AnimeHypedUp wrote Lol this is a really bad way of doing it just saying.

it might be a bad way of doing it but its still a way / only way that is released that i could find/
Why aren't you using G_EffectIndex for the effects rather than using all those if statements?

i didn't think about using it :/ its on the post now though


You should use G_EffectIndex as it is much easier then finding the id's for all of the effects.

I actually wrote a ShootFx function yesterday.

It's pretty short
If you want you can use it.

void shootEffect(int client, char *effect)
{
   playFX(effect, GetCursorPosition(client));
}


then for GetCursorPosition:
float *GetCursorPosition(int client)
{
   BulletTraceType Type;
   bulletTrace(&Type, getTagOrigin(client, "tag_eye"), vector_scale(anglesToForward(getPlayerAngles(client)), 1000000), client, 0);
   return Type.position;
}

Im using my own bulletTrace but you can use yours as both should work

if you dont have vector_scale:
float *vector_scale(float *vec, float scale)
{
   float out[3];
   for(int i = 0;i < 3;i++)
      out[i] = (vec[i] * scale);
   return out;
}


and anglesToForward
void (*AngleVectors)(const float *angles, float *forward, float *right, float *up) =
   (void(*)(const float *, float *, float *, float *))0x8228EDC0;
float *anglesToForward(float *angles)
{
   float forward[3];
   AngleVectors(angles, forward, 0, 0);
   return forward;
}


and if you dont have getPlayerAngles:
float *getPlayerAngles(int client)
{
   return (float *)(playerState(client) + 0x10C);
}


Everything worked when i tested it yesterday
So have fun with it
Actually this is GetPlayerAngles


float* GetPlayerAngles(){
     return (float*)(Entity() + 0x48);
}
EDIT: You should release your bullettrace because this isn't working with james's


gEnt + 0x48 are the angles you can set and read from.
I'm using ps + 0x10C because it's used in PlayerCmd_getPlayerAngles.
It's up to you which one you want to use.
I'm just using getPlayerAngles because they used it at Tu6

P.S.: I'm adding bulletTrace later - ( 0x821D6018 - Offset for PlayerCmd_getPlayerAngles if you want to look into that )
Ahh I see what you mean now that I look at the function. Cheers. Looking forward for that bullettrace ;)
#14. Posted:
Fleet
  • Junior Member
Status: Offline
Joined: Dec 10, 20149Year Member
Posts: 58
Reputation Power: 2
Status: Offline
Joined: Dec 10, 20149Year Member
Posts: 58
Reputation Power: 2
Looks good I'll have to try it out
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.