17 Apr 11, 07:09AM
(This post was last modified: 17 Apr 11, 07:24AM by Ronald_Reagan.)
[SELECT ALL] Code:
// Start Globals and reset
alias sp_reset_glbs [
sp_glb_max_posx = []
sp_glb_min_posx = []
sp_glb_max_posy = []
sp_glb_min_posy = []
sp_glb_event = [echo "You're there! You should also never see this message!"]
]
sp_reset_glbs //clean up from last session
// Start Functions
alias disp_pos [echo (c 4)X: (c 2)(getposition 0) (c 4)Y: (c 2)(getposition 1) (c 4)Z: (c 2)(getposition 2) (c 4)Yaw: (c 2)(getposition 3)]
alias sp_test_pos [if (&& (&& (< (getposition 0) $sp_glb_max_posx) (> (getposition 0) $sp_glb_min_posx)) (&& (< (getposition 1) $sp_glb_max_posy) (> (getposition 1) $sp_glb_min_posy))) [sp_glb_event] [] ]
alias sp_mainloop [sp_test_pos; sleep 10 [sp_mainloop]]
// Game Loops
alias sp_shine_game_1 [
ctf ac_shine;
sp_glb_max_posx = 133.42
sp_glb_min_posx = 130.47
sp_glb_max_posy = 195.56
sp_glb_min_posy = 192.39
sp_glb_event = [sp_shine_game_2]
sleep 1000 [
echo (c 2)Go to (c 3)red (c 2)base, when you are on the flag, the time starts!
sp_mainloop ]
]
sp_shine_time = 0
alias sp_shine_timer [sleep 500 [sp_shine_time = (+ (sp_shine_time) 1); sp_shine_timer]]
alias sp_stoptimer [
push sp_shine_timer []
sleep 501 [pop sp_shine_timer]]
alias sp_shine_game_2 [
sp_reset_glbs
echo (c 3)Gooo!
sp_glb_max_posx = 170.9
sp_glb_min_posx = 150.1
sp_glb_max_posy = 60.9
sp_glb_min_posy = 48.1
sp_glb_event = [sp_shine_game_end]
sp_shine_timer
]
alias sp_shine_game_end [
sp_reset_glbs
sp_stoptimer
sp_shine_game_score = (divf (sp_shine_time) 2)
sleep 1000 [sp_shine_time = 0]
echo (c 3) annnd Stop!
echo (c 2) Your time was: (c 3)(sp_shine_game_score) (c 2)seconds.
]
Prelims to my future script. You need SVN, to start type (with script loaded ofc) /sp_shine_game_1