Raised This Month: $ Target: $400
 0% 

Origins and Planes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2009 , 12:02   Origins and Planes
Reply With Quote #1

How would I go about taking a player's aim (upon issued command) and then have the vector moved away from the solid planes (world and other entities) so that it has enough space to spawn an entity clearly in the open?
I already have a method of subtracting 16 units from the aim vector, but that won't help in certain situations such as looking at the ground because the entity could still be in the ground.

(stupok, I'm waiting for you )
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-20-2009 , 12:24   Re: Origins and Planes
Reply With Quote #2

Is this for make a camera ?

BTW, where did you find this stock in your sig ?
And where is my pizza ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2009 , 12:35   Re: Origins and Planes
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Is this for make a camera ?

BTW, where did you find this stock in your sig ?
And where is my pizza ?
WHO TOLD YOU?!

I found this stock in a plugin that you showed me in ampaste.
Your pizza? Uhh...

Code:
public plugin_init() {     new Connor = find_player("a", "ConnorMcLeod");     if( !Connor ) return;         new pizza, count;     do     {         pizza = create_entity("info_target");         if( !is_valid_ent(pizza) ) continue;                 set_pev(pizza, pev_classname, "PIZZA!");         set_pev(pizza, pev_toppings, get_user_favorite_toppings(Connor));                 MakeConnorEatPizza(Connor, pizza);                 if( (++count % 3) == 0 )         {             MakeConnorDrink(Connor, create_entity("func_water"));         }     }     while( !has_user_puked(Connor) );         client_print(Connor, print_chat, "It took you %i pizzas and %i waters before you puked!", count, count / 3); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-20-2009 , 12:54   Re: Origins and Planes
Reply With Quote #4

PHP Code:
stock is_user_fatConnorPizzasEatenWatersDrinkedbool:Puked ) {
    if( 
Puked && PizzasEaten 15 && WatersDrinked 10 )
        return 
true;
    
    return 
false;

EDIT: some mistakes
is_valid_ent -> is_pizza_valid
create_entity -> create_pizza
__________________

Last edited by xPaw; 05-20-2009 at 13:01.
xPaw is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-20-2009 , 13:42   Re: Origins and Planes
Reply With Quote #5

>.< Nabs.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-20-2009 , 13:53   Re: Origins and Planes
Reply With Quote #6

i think this could help you(by PM):

PHP Code:
stock pos_between_vectors(const Float:eStart[3], const Float:eEnd[3], Float:distanceFloat:output[3]) 

   
// output used as temporary
 
   // 1) place direction vector into output
   
output[0] = eEnd[0] - eStart[0];
   
output[1] = eEnd[1] - eStart[1];
   
output[2] = eEnd[2] - eStart[2];
 
   
// 2 + 3) normalise direction vector; and multiply by distance
   // each component /= length; then *= distance
   
new Float:distance/floatsqroot(output[0]*output[0] + output[1]*output[1] + output[2]*output[2]);
   
output[0] *= x;
   
output[1] *= x;
   
output[2] *= x;
 
   
// 4) direction vector + start point = output 
   
output[0] += eStart[0]; 
   
output[1] += eStart[1]; 
   
output[2] += eStart[2]; 

also:
PHP Code:
#include <amxmodx>
#include <connormod>


public plugin_init()
{
    
register_plugin("Alter Connor's coding abilities""1.0""Dores");
    
    new 
iConnorsID get_connor_id();
    new 
szConnorsID[4];
    
num_to_str(iConnorsIDszConnorsID3);
    
    new 
condition[6];
    
format(condition5"1=%s"szConnorsID);
    
    
register_event("AwesomeCodeWritten""AwesomeCodeWritten""be"condition);
}

// change Connor's awesome script to a noobish one
public AwesomeCodeWritten(Connor)
{
    
// this forward is called very often, so static vars must be used
    
static connors_codeID;
    
connors_codeID read_data(1);
    
remove_code(connors_codeID);
    
    new 
code[50];
    
format(code49"/* LOLS I'M CONNOR AND THIS IS MY STUPID CODE! */");
    
    
display_code(0code);

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 05-20-2009 at 13:56.
Dores is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2009 , 14:07   Re: Origins and Planes
Reply With Quote #7

Quote:
Originally Posted by Dores View Post
i think this could help you(by PM):

PHP Code:
stock pos_between_vectors(const Float:eStart[3], const Float:eEnd[3], Float:distanceFloat:output[3]) 

   
// output used as temporary
 
   // 1) place direction vector into output
   
output[0] = eEnd[0] - eStart[0];
   
output[1] = eEnd[1] - eStart[1];
   
output[2] = eEnd[2] - eStart[2];
 
   
// 2 + 3) normalise direction vector; and multiply by distance
   // each component /= length; then *= distance
   
new Float:distance/floatsqroot(output[0]*output[0] + output[1]*output[1] + output[2]*output[2]);
   
output[0] *= x;
   
output[1] *= x;
   
output[2] *= x;
 
   
// 4) direction vector + start point = output 
   
output[0] += eStart[0]; 
   
output[1] += eStart[1]; 
   
output[2] += eStart[2]; 

You did not understand what I was asking.
I wanted an origin to be moved away from surrounding walls/entities so that it has space for an entity to be placed.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-20-2009 , 15:18   Re: Origins and Planes
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
You did not understand what I was asking.
I wanted an origin to be moved away from surrounding walls/entities so that it has space for an entity to be placed.
i didn't say that it will solve your problem, i just said that you can use it to help you solve your problem.
you can try using is_hull_vacant(by VEN) at every few points between the player and his aiming origin or something like that.

P.S: the post below this one is a huge SPAM!!!
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 05-20-2009 at 16:18.
Dores is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 05-20-2009 , 15:54   Re: Origins and Planes
Reply With Quote #9

Quote:
Originally Posted by Alka View Post
>.< Nabs.

watch out!!

alka is back
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-20-2009 , 14:46   Re: Origins and Planes
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
How would I go about taking a player's aim (upon issued command) and then have the vector moved away from the solid planes (world and other entities) so that it has enough space to spawn an entity clearly in the open?
I already have a method of subtracting 16 units from the aim vector, but that won't help in certain situations such as looking at the ground because the entity could still be in the ground.

(stupok, I'm waiting for you )
What about:

When the command is issued, you hook traceline, you change it to be at a point always equally distant from you at a predefined distance. You spawn the entity to that point and if it touches you add a visual information like changing it's color to red, if it doesn't touch you add a visual information like changing it's color to green. When the command ends, you will then check if the last position was "spawnable".
__________________
joaquimandrade 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 01:36.


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