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

Solved [CSGO] Slap back.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-27-2018 , 13:59   [CSGO] Slap back.
Reply With Quote #1

public BitchSlap(victim)
{
new Float:vec[3];

new Float:Min = 1000.0, Float:Max = 1000.0;

vec[0] = GetRandomFloat(Min, Max);
vec[1] = GetRandomFloat(Min, Max);
vec[2] = GetRandomFloat(Min, Max);

TeleportEntity(victim, NULL_VECTOR, NULL_VECTOR, vec);
}

I'm currently using this WORKING stock ( or public lol ) which makes the target fly in a random direction. If there's an attacker to this, how to make the victim fly backwards to the attacker's location? I'm a bit bad at vectors :/

Edit: Solved by using this CS 1.6 plugin:

https://forums.alliedmods.net/showth...ight=dodgeball
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 06-28-2018 at 03:42.
eyal282 is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 06-27-2018 , 14:45   Re: [CSGO] Slap back.
Reply With Quote #2

I don't really understand what you mean, but you can invert any vector by switching the signs of its components. Like this:

inverse_vec[0] = -vec[0];
inverse_vec[1] = -vec[1];
inverse_vec[2] = -vec[2];
akcaliberg is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 06-28-2018 , 02:35   Re: [CSGO] Slap back.
Reply With Quote #3

To get a vector going from one position vector to another, all you have to do is subtract them. So for example if you have 2 position vectors start & end, the vector going from start to end is "end - start".

In your case you have the positions of the slapper and the slapee(?), so to get a vector going from the slapper to the slapee you do "slapee - slapper"
hmmmmm is offline
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 10:36.


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