AlliedModders

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

DiscoBBQ 03-14-2005 20:29

Origin help
 
Ok well. For my server i made an inventory mod
and theres likea few 'rare items' that im adding.
one is a teleport necklas.
I want it so when you type the cmd i want it to set you 200 coords infront of the direction your facing.
Right now it just sets you 200 coords in one dirrection in which you cannot change. Help + example maybe?
Thanks,
Pinkfairie

This is what i use now, but only in one direction. NOT where you point...

Quote:

new origin[3];
get_user_origin(id,origin);
origin[1] += 200;
set_user_origin(id,origin);

TotalNoobScripter 03-14-2005 21:01

hehe teleporting necklace for rp? are you sure your rp mod is going to be realistic :D

anyways, id find a way to reset one's view so it is centered (isnt there a command that does that?) then get where they are aiming, then use some math to find out which way to teleport them (i.e. north south east or west of their position.) you could do (where 1 = player positon and 2 = aiming position) if y2-y1 < 0, then set the player origin to his origin but -200 y. if y2-y1 > 0 then set player origin to his origin but +200 y. If y2-y1 = 0, then do the same thign but with x's (i.e. x2-x1 < 0 and > 0)
It might not work, but its worth a try!

Crazywelder1 03-15-2005 00:55

i think u just need to add 1 like so

Code:

new origin[3];
get_user_origin(id,origin,1);
origin[1] += 200;
set_user_origin(id,origin);


DiscoBBQ 03-15-2005 20:42

eh
 
im gonna try the 2nd persons. Its easy

and no, my rp isnt that realistic.
I have like 24 inventory items so far, gems that convert to armor, 4 rare items (tele necklas, Pink robes, dragon armor+helmet), 5 drugs, 5 foods, and potions.

and then every holdiday i add new rare items. such as this friday im making a leprecuan pickaxe to make them able to mine gold which converts to coins.
then on easter. a white bunny suit it glows + somethin else
ext

Crazywelder1 03-15-2005 22:33

did this work???
or was i wrong
i just want to know

XxAvalanchexX 03-16-2005 13:41

Crazywelder, yours wouldn't work. It will always move the user in the same direction no matter which direction they are facing. You have to figure out the correct mathematical formula to find a position in front of their view, which I don't happen to know.


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

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