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
Code:
...
It was never printed...
... because there is no forward called register_natives(). It's called plugin_natives().
You have to learn how to debug using server_print(). It is the most powerful debugging tool you could ever have.
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
Code:
...
It was never printed...
... because there is no forward called register_natives(). It's called plugin_natives().
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
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
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.