AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with maps and plugins (https://forums.alliedmods.net/showthread.php?t=83429)

Arphenius 01-09-2009 14:39

Help with maps and plugins
 
Hello. I'm working on a plugin, and this plugin requires some informations of the current position of the players in a custom map I made. I don't know how to get the position of the players, and if this is possible, I think is better to make the map send informations when some player touch a defined block. I need help with this problem. Thanks

SnoW 01-09-2009 14:44

Re: Help with maps and plugins
 
I suggest that you read some includes before posting.
Quote:

/* Gets origin from player.
* Modes:
* 0 - current position.
* 1 - position from eyes (weapon aiming).
* 2 - end position from player position.
* 3 - end position from eyes (hit point for weapon).
* 4 - position of last bullet hit (only CS). */
native get_user_origin(index, origin[3], mode = 0);

Exolent[jNr] 01-09-2009 14:45

Re: Help with maps and plugins
 
You can get the X,Y,Z of the player in multiple ways:

Code:
#include <amxmodx> new origin[3]; get_user_origin(id, origin);

Code:
#include <fakemeta> new Float:origin[3]; pev(id, pev_origin, origin);

Code:
#include <engine> new Float:origin[3]; entity_get_vector(id, EV_VEC_origin, origin);

origin[0] = X coordinate
origin[1] = Y coordinate
origin[2] = Z coordinate

Arphenius 01-09-2009 15:19

Re: Help with maps and plugins
 
Wow, thanks for the help and sorry for not searching. I will use the

Code:

#include <amxmodx>

new origin[3];
get_user_origin(id, origin);

but I don't know how to get the position of my char in-game, playing with my map, so I can add the positions in the script. There is a way to make a trigger in my map and make my plugin verify if one player touched it? I think this way is better. Thank you all


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

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