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

Solved INC File, Floating Weapon, Weapon Owner, Player Origins.


Post New Thread Reply   
 
Thread Tools Display Modes
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 01-19-2017 , 16:32   Re: INC File, Floating Weapon, Weapon Owner, Player Origins.
Reply With Quote #21

I assume your problem about placing two people somewhere is about where to actually place them, not how the natives work.
It's hard placing two persons randomly on a map without pre-made checkpoints. Theres just no way of telling if the spot selected is actually a part of the playable map. You could pathfind between the two spawns and that may be successful. You may then select two points that are X units away from eachother. You could compare the X or Y, make sure one of them is constant during the steps in between and voila, you have placed two persons in sight of eachother. You could then calculate the angle to make them face eachother or away from.
However, this only applies to a bunch of maps. On some maps you just can't do that because there might be a jump from the spawn which you cannot get up from again or similar "gaps" that make it impossible to find a good path, surf maps for example. Pathfinding is tricky business and CPU hungry.

Now let's continue with your easy problem. Here's how you debug your own code:
server_print()

Code:
public register_natives() {     server_print("^n^n^nIS THIS THING EVEN CALLED!?^n^n^n");     register_library( "lxs_system" )     register_native( "lxs_get_user_xp", "native_get_user_xp");     register_native( "lxs_set_user_xp", "native_set_user_xp");     register_native( "lxs_get_user_level", "native_get_user_level");     register_native( "lxs_set_user_level", "native_set_user_level");     register_native( "lxs_reset_user_xp", "native_reset_user_xp");     register_native( "lxs_reset_user_level", "native_reset_user_level"); }

Spoiler


You have to learn how to debug using server_print(). It is the most powerful debugging tool you could ever have.
__________________

Last edited by Black Rose; 01-19-2017 at 16:42.
Black Rose is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-19-2017 , 16:48   Re: INC File, Floating Weapon, Weapon Owner, Player Origins.
Reply With Quote #22

Quote:
Originally Posted by Black Rose View Post
I assume your problem about placing two people somewhere is about where to actually place them, not how the natives work.
It's hard placing two persons randomly on a map without pre-made checkpoints. Theres just no way of telling if the spot selected is actually a part of the playable map. You could pathfind between the two spawns and that may be successful. You may then select two points that are X units away from eachother. You could compare the X or Y, make sure one of them is constant during the steps in between and voila, you have placed two persons in sight of eachother. You could then calculate the angle to make them face eachother or away from.
However, this only applies to a bunch of maps. On some maps you just can't do that because there might be a jump from the spawn which you cannot get up from again or similar "gaps" that make it impossible to find a good path, surf maps for example. Pathfinding is tricky business and CPU hungry.

Now let's continue with your easy problem. Here's how you debug your own code:
server_print()

Code:
public register_natives() {     server_print("^n^n^nIS THIS THING EVEN CALLED!?^n^n^n");     register_library( "lxs_system" )     register_native( "lxs_get_user_xp", "native_get_user_xp");     register_native( "lxs_set_user_xp", "native_set_user_xp");     register_native( "lxs_get_user_level", "native_get_user_level");     register_native( "lxs_set_user_level", "native_set_user_level");     register_native( "lxs_reset_user_xp", "native_reset_user_xp");     register_native( "lxs_reset_user_level", "native_reset_user_level"); }

Spoiler


You have to learn how to debug using server_print(). It is the most powerful debugging tool you could ever have.
WHAT THE HELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL LLLLLL I've been wondering for months , I hate it when compiler doesn't throw error on these cases, thank you a lot !


Quote:
Originally Posted by jackp View Post
I know it's a native, but it will do nothing, am I blind or something? Either you are missing something or i'm missing something cause the include seems incomplete.

Edit: If you want to set origins, this works and I don't see if it has any risks

PHP Code:

new Float:origin[3];

set_pev(idpev_originorigin)
set_pev(idpev_velocity, { 0.00.00.0 }) 
You need to get coordinates you want and put them in the origin array.
Origin[0] = X
Origin[1] = Y
Origin[2] = Z
Black Rose already pointed out the mistake. And I know how to set origins I just wanted to know how to set 2 players near each other in a duel position (eye to eye) but nvm.
__________________
edon1337 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 18:39.


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