Raised This Month: $ Target: $400
 0% 

better way for GODMODE?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gzus
Member
Join Date: Jan 2007
Old 02-14-2007 , 00:42   better way for GODMODE?
Reply With Quote #1

ive searched hi/high and low for a better way to do this, but im stumped.

when a user types mho_special in console, it executes this:
PHP Code:
 [small]
new 
godloop[33]

#define GOD_LIFE 10

public MHO_GOD_Mode(id){
    
godloop[id] = GOD_LIFE
    
//Hold_GOD(id)
    //set_task(1.0,"Reset_GOD_loop",id)
    
set_task(1.0,"Hold_GOD",id)
}

public 
Hold_GOD(id){
    if (
godloop[id] != 1)
    
set_user_godmode(id,0)
    
server_print("--MHO MOD-- GOD MODE [ON]",0.01)
    new 
message[128]
    
format(message127"%d seconds left of GOD Mode.^n"godloop[id] )
    
set_hudmessage(255,0,0,-1.0,0.3,0,1.0,1.2,0.0,0.0,87)
    
show_hudmessageidmessage)
    
//godloop[id]--
    //emit_sound(id,CHAN_VOICE,"misc/mysound.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
    //Hold_GOD(id)
    
if (godloop[id] <= 1) {
    
Reset_GOD_loop(id)
    }
    return 
PLUGIN_HANDLED
}

public 
Reset_GOD_loop(id){
    
godloop[id] = 0
    set_user_godmode
(id)
    
server_print("--MHO MOD-- GOD MODE [OFF]",0.01)
}
[/
small
any other ideas? for some reason this really just doesnt even set godmod to on, it claims it does, and as far as ive read u set 0, and bam, ur god, if the second parm is not set, its off, the console never gets to display when its set off, because i got killed too fast, so im just like yea ok F U TOO fun include... F U! heh
__________________
71.200.20.142:27017 - testing mho mod
if you need any files visit clan.mosthatedonline.com
gzus is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-14-2007 , 00:54   Re: better way for GODMODE?
Reply With Quote #2

Code:
    if (godloop[id] != 1)     set_user_godmode(id,0)

becomes

Code:
    if (godloop[id] != 1)     set_user_godmode(id,1)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
gzus
Member
Join Date: Jan 2007
Old 02-14-2007 , 01:13   Re: better way for GODMODE?
Reply With Quote #3

i was under the inpression it just has to have a var there, i didnt even think twice if it should be 1 LOL!
[bangs head on desk] thanks man +karma for not flamin on me!
__________________
71.200.20.142:27017 - testing mho mod
if you need any files visit clan.mosthatedonline.com
gzus is offline
gzus
Member
Join Date: Jan 2007
Old 02-14-2007 , 22:17   Re: better way for GODMODE?
Reply With Quote #4

ok, heres the problem, i had this working earlier today to where it would actually count down the seconds left of godmode, but it doesnt now, it only displays the one time msg saying there is 10 seconds left of god mode, and craps out.. i added the server prints to try and debug it myself, to see what part of the code actually gets called, and whats bypassed, but im lost, ive even copied/pasted the code from above, (the first snippet), and it only counts once, im stumped, anyone have any suguestions as to what i should change/try?

Code:
<font color="#000000"><font color="#007700">new </font><font color="#0000bb">godloop</font><font color="#007700">[</font><font color="#0000bb">33</font><font color="#007700">] </font><font color="#ff8000">#define GOD_LIFE 10 </font></font> //machine mho_special public MHO_GOD_Mode(id){     godloop[id] = GOD_LIFE     //Hold_GOD(id)     //set_task(1.0,"Reset_GOD_loop",id)     set_task(1.0,"Hold_GOD",id) } public Hold_GOD(id){     if (godloop[id] != 1)         set_user_godmode(id,1)     server_print("--MHO MOD-- GOD MODE [ON]",0.01)     new message[128]     format(message, 127, "%d seconds left of GOD Mode.^n", godloop[id] )     set_hudmessage(255,0,0,-1.0,0.3,0,1.0,1.2,0.0,0.0,87)     show_hudmessage( id, message)     if (godloop[id] <= 1) {         server_print("--MHO MOD-- GOD MODE [FINISHED]",0.01)         Reset_GOD_loop(id)         } else {         //Hold_GOD(id)         server_print("--MHO MOD-- GOD MODE [HOLDING]",0.01)     }     return PLUGIN_HANDLED } public Reset_GOD_loop(id){     godloop[id] = 0     set_user_godmode(id)     server_print("--MHO MOD-- GOD MODE [OFF]",0.01) }
__________________
71.200.20.142:27017 - testing mho mod
if you need any files visit clan.mosthatedonline.com
gzus is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-14-2007 , 23:00   Re: better way for GODMODE?
Reply With Quote #5

You set the task once, but never call the function again.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
gzus
Member
Join Date: Jan 2007
Old 02-14-2007 , 23:02   Re: better way for GODMODE?
Reply With Quote #6

call Hold_GOD or MHO_GOD_Mode again? use it where i have Hold_GOD commented out?
__________________
71.200.20.142:27017 - testing mho mod
if you need any files visit clan.mosthatedonline.com
gzus is offline
gzus
Member
Join Date: Jan 2007
Old 02-15-2007 , 09:07   Re: better way for GODMODE?
Reply With Quote #7

im really lost on this.. the set task tut doesnt really help me much, maybe im not reading between the lines or something, but even so, how is this set task supposed to loop, and even count down at that?

[slumps over waiting for someone to yell at me]
__________________
71.200.20.142:27017 - testing mho mod
if you need any files visit clan.mosthatedonline.com
gzus is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-15-2007 , 19:18   Re: better way for GODMODE?
Reply With Quote #8

Call the task again, or use the loop parameters of set_task.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-16-2007 , 02:52   Re: better way for GODMODE?
Reply With Quote #9

Code:
#include <amxmodx> #include <fun> #define GOD_LIFE 10 new godloop[33] //machine mho_special public MHO_GOD_Mode(id){     godloop[id] = GOD_LIFE     server_print("--MHO MOD-- GOD MODE [ON]")     set_user_godmode(id, 1)     set_task(1.0, "Hold_GOD", id, "", 0, "a", GOD_LIFE) } public Hold_GOD(id){         godloop[id]--         show_hud(id)         if ( ! godloop[id] ) {         set_user_godmode(id)         server_print("--MHO MOD-- GOD MODE [OFF]")     } } stock show_hud(id) {     new message[32]     formatex(message, 31, "%d seconds left of GOD Mode.", godloop[id])     set_hudmessage(255, 0, 0, -1.0, 0.3, 0, 1.0, 1.2, 0.0, 0.0, 87)     show_hudmessage(id, message) }
[ --<-@ ] Black Rose is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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