AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Finding origin. (https://forums.alliedmods.net/showthread.php?t=57090)

Da_sk8rboy 06-28-2007 02:03

Finding origin.
 
Okay, I feel like an idiot, I know it's something small.

Code:
#include <amxmodx> #include <amxmisc>   #define PLUGIN "Find Origin" #define VERSION "1.0" #define AUTHOR "Brit Jamerson" public plugin_init() {  register_plugin(PLUGIN, VERSION, AUTHOR)  register_clcmd("say /findorigin", "fo_base") }   public fo_base(id) {  new origin[0]  get_user_origin(id, 0) }


Not sure what I did wrong, I'm trying to find the origin whereever the player uses the say cmd :|

Drak 06-28-2007 02:08

Re: Finding origin.
 
Code:
public fo_base(id) {  new origin[3]  get_user_origin(id, origin) }

Da_sk8rboy 06-28-2007 03:38

Re: Finding origin.
 
Quote:

/home/groups/amxmodx/tmp3/text9pyaqh.sma(17) : error 009: invalid array size (negative or zero)
/home/groups/amxmodx/tmp3/text9pyaqh.sma(17) : error 017: undefined symbol "origin"

Alka 06-28-2007 04:23

Re: Finding origin.
 
SixTwin code is correct! :wink:
You have extra code?

Arkshine 06-28-2007 04:24

Re: Finding origin.
 
SixTwin is right andt it compiles fine.

What's your code exactly ?

Da_sk8rboy 06-28-2007 05:00

Re: Finding origin.
 
Wait, I see the problem, I used:
Code:
new origin[0]
instead of:
Code:
new origin[3]

warlock 06-28-2007 12:48

Re: Finding origin.
 
Quote:

Originally Posted by Da_sk8rboy (Post 495708)
Wait, I see the problem, I used:
Code:
new origin[0]
instead of:
Code:
new origin[3]

public fo_base(id)
{
new origin[__3___]
get_user_origin(__id, origin__)
}


You forgot the id, origin part.

kmal2t 06-29-2007 02:50

Re: Finding origin.
 
I would use this personally:
Code:
#include <amxmodx> #include <fakemeta> new Float:origin[33][3]; public plugin_init() {     register_clcmd("say /myorigin", "MyOrigin"); }   public MyOrigin(id) {     pev(id, pev_origin, origin[id]);     client_print(id, print_chat, "X: %f Y: %f Z: %f ", origin[id][0],origin[id][1],origin[id][2]); }


All times are GMT -4. The time now is 21:24.

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