Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($text=~/#fart/i) {
- my $target = $client->GetTarget();
- my $head = ($client->CalculateHeadingToTarget($target->GetX(), $target->GetY()) / 256) * 360;
- my $distance = $client->CalculateDistance($target->GetX(), $target->GetY(), $target->GetZ());
- if($head > 360) { $head -= 360;}
- my $head_x = sin(($head * 3.141592 / 180.0));
- my $head_y = cos(($head * 3.141592 / 180.0));
- my $distance_z = abs(($client->GetZ() - $target->GetZ()));
- my $knockback = (($distance- ($distance_z * 1)) / 100) * 3.75;
- my $knockup = 10;
- #Knockup 20 ... 2.75 per 100 distance
- #knockup 15 ... 3.25 per 100 distance (super close)
- #Knockup 10 ... 3.75 per 100 distance - z * .75
- #Knockup 5 ... 5.75 per 100 distance - z * 1.5
- my $new_x = $knockback * sin(($head * 3.141592 / 180.0));
- my $new_y = $knockback * cos(($head * 3.141592 / 180.0));
- #distance = X * H * sin shit distance / (x * h) = ~sin
- my $cx = $client->GetX();
- my $cy = $client->GetY();
- $client->MoveLocation($new_x, $new_y, $knockup);
- $client->Message(315, "DISTANCE $distance .. Z dist = $distance_z");
- #$client->Message(315, "HEAD ...X = $head_x ... Y = $head_y");
- $client->Message(315, "MY LOC X = $cx .. Y = $cy");
- $client->Message(315, "FINAL ...X = $new_x ... Y = $new_y");
- }
- if($text=~/#lol/i) {
- my @client_list =$entity_list->GetClientList();
- foreach $c (@client_list) {
- next if $c->Admin() > 0;
- my $head = ($c->CalculateHeadingToTarget($client->GetX(), $client->GetY()) / 256) * 360;
- my $distance = $c->CalculateDistance($client->GetX(), $client->GetY(), $client->GetZ());
- if($head > 360) { $head -= 360;}
- my $head_x = sin(($head * 3.141592 / 180.0));
- my $head_y = cos(($head * 3.141592 / 180.0));
- my $distance_z = abs(($c->GetZ() - $client->GetZ()));
- my $knockback = (($distance- ($distance_z * 1)) / 100) * 3.75;
- my $knockup = 10;
- my $new_x = $knockback * sin(($head * 3.141592 / 180.0));
- my $new_y = $knockback * cos(($head * 3.141592 / 180.0));
- $c->MoveLocation($new_x, $new_y, $knockup);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement