AlliedModders

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

LynX 05-08-2005 11:07

index retreive
 
Well, I have this thing

Code:
public origin_set(id) { new index, bodypart get_user_aiming(id, index, bodypart) if(index) { New Float:origin[3] origin[2] -= 50.0 entity_set_origin(index,origin) } else { } return PLUGIN_HANDLED }

Now, in other public, where I CAN'T LOOK AT THAT ENTITY AGAIN, I must set its origin again... Now, how the heck I can do that?
I can't use "index" again... So, any help?

v3x 05-08-2005 11:12

Make it global.

LynX 05-08-2005 11:20

I mean, I can just make index outside as index[33] or just index ?
And then in another function just set its origin again without having to aim at it again

v3x 05-08-2005 11:28

Or I guess you could do this:
Code:
public origin_set(id) {     new index, bodypart     get_user_aiming(id, index, bodypart)     if(index) {         New Float:origin[3]         origin[2] -= 50.0         entity_set_origin(index,origin)     }     else {     }     return PLUGIN_HANDLED } // Somewhere in that above function: myfunc(index,origin) public myfunc(parm,parm2) {     entity_set_origin(parm,parm2) }

LynX 05-08-2005 11:40

Now I'm confused...
What parm and parm2 ? :?
Can you explain it?

v3x 05-08-2005 11:47

They are replace with index and origin:
myfunc(index,origin)

LynX 05-09-2005 18:53

Could I make it like this:

Code:
public myfunc(id, parm, parm2) { // }

Parm2 is replaced with float, right?

v3x 05-09-2005 18:59

Yea.
Code:
myfunc(origin[1],origin[2])
Should work then..

LynX 05-10-2005 04:14

I know I'm too boring, but since I don't understand this fully...
How would I make that player who went down gets right in front of player when I use that function?

sambro 05-12-2005 19:24

I still can't figure out what you're trying to do.

Are you trying to set a users' origin when you execute this command pointing at them, then move them again after that in quick succession?

If so, you might be interested in set_task.


All times are GMT -4. The time now is 16:45.

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