AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Origin points (https://forums.alliedmods.net/showthread.php?t=277545)

Jhob94 01-10-2016 21:08

Origin points
 
Lets say i've a random origin.
I need to change Origin[2] value in order to it goes verticaly to the original value. How can i do that?

Let's say
....HERE....
......|........
......|........
......|........
......|........
......o/......

fysiks 01-10-2016 21:16

Re: Origin points
 
What "original value"?

Jhob94 01-10-2016 21:17

Re: Origin points
 
Some random value getting pev_origin from some entity/player.
Then i need to change the last slot of that origin to get a new origin point vertical to that one.

fysiks 01-10-2016 21:31

Re: Origin points
 
You answered your own question before you asked it. Read your original post.

Jhob94 01-10-2016 21:41

Re: Origin points
 
I know what i've to do. The problem is i don't know how. Maybe the solution is easy but i'm lost right now.
Spent a lot of hours finding out what the problem was, it's 2:40am and my brain is dead xD

fysiks 01-10-2016 21:49

Re: Origin points
 
Explain what you are actually trying to do because the question you asked is "how do I add a number to a number?".

UchihaMadara 01-10-2016 22:02

Re: Origin points
 
go vertically, you mean go up/down ?

PHP Code:

new Float:Origin[3// First Origin
new Float:Origin2[3// Second Origin

Origin2 Origin
Origin2
[2] -= 36.0 // go down 36 units?
Origin2[2] += 36.0 // go up 36 units? 


siriusmd99 01-11-2016 03:24

Re: Origin points
 
You can randomize only origin[0] and origin [1], holding origin[2] untouchable, show code where you randomize origin.

abdobiskra 01-11-2016 03:36

Re: Origin points
 
PHP Code:

public plugin_init() {
   
register_plugin("xx""xx""xxx")
   
register_clcmd("say /get","Get")
}
public 
Get(id){
   new 
origin[3]
   
get_user_origin(idorigin)
   
client_print(idprint_chat"origin ------> %d %d %d",origin[0],origin[1],origin[2])



fysiks 01-11-2016 19:36

Re: Origin points
 
Quote:

Originally Posted by abdobiskra (Post 2382155)
PHP Code:

public plugin_init() {
   
register_plugin("xx""xx""xxx")
   
register_clcmd("say /get","Get")
}
public 
Get(id){
   new 
origin[3]
   
get_user_origin(idorigin)
   
client_print(idprint_chat"origin ------> %d %d %d",origin[0],origin[1],origin[2])



You should probably actually read the thread before posting irrelevant code.


All times are GMT -4. The time now is 09:32.

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