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

get_distance_f cant compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elantra86
Member
Join Date: Feb 2014
Old 03-15-2014 , 15:04   get_distance_f cant compile
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
 
#define PLUGIN "[http://amxxmodx.ru] get_distance_f"
#define VERSION "1.0"
#define AUTHOR "Admin"
 
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say dis","dis")
}

public dis(id){
new Float:forigin[3]
new Float:sorigin[3]
get_user_origin(id, forigin)
get_user_origin(id, sorigin, 3)  
new Float:distance = get_distance_f(forigin,sorigin)
client_print(0,print_chat,"Dist:%f",distance)
// client_print(0, print_chat, "Your current origin is %ix, %iy, %iz", sorigin[0], sorigin[1], sorigin[2])
}
if i print one of sorigin or forigin it works.
but cant get distance.
where i do mistake plz help.
thx in advance

Last edited by elantra86; 03-15-2014 at 15:04.
elantra86 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-15-2014 , 15:14   Re: get_distance_f cant compile
Reply With Quote #2

It compiles just fine, though get_user_origin isn't expecting a Float.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
elantra86
Member
Join Date: Feb 2014
Old 03-15-2014 , 15:44   Re: get_distance_f cant compile
Reply With Quote #3

compiled norm(with warning 213: tag mismatch)
but when i say dis in game
result is :
Dist:0.000000

Need distance from my point to aiming point.

Last edited by elantra86; 03-15-2014 at 16:00.
elantra86 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-15-2014 , 18:51   Re: get_distance_f cant compile
Reply With Quote #4

You're mixing functions that are based on floats and functions that are based on integers.
You need to choose one and stick with it.
The way to do it with floats is not for beginners.

Code:
public dis(id){     new forigin[3]     new sorigin[3]     get_user_origin(id, forigin)     get_user_origin(id, sorigin, 3)     new distance = get_distance(forigin, sorigin)     client_print(0, print_chat,"Dist: %d",distance) }
__________________

Last edited by Black Rose; 03-15-2014 at 18:52.
Black Rose is offline
elantra86
Member
Join Date: Feb 2014
Old 03-16-2014 , 03:29   Re: get_distance_f cant compile
Reply With Quote #5

Thx it's works for me!!!
& 1 question .
how can i replace hud armor value with this value.
(that it would be updated automatically without command)
sorry for my english &thx in advance.
elantra86 is offline
Old 03-16-2014, 08:15
Black Rose
This message has been deleted by Black Rose. Reason: Nvm, I understand now, but don't know.
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 20:06.


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