Raised This Month: $ Target: $400
 0% 

A couple of questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mirun.Frontier
Member
Join Date: Aug 2008
Old 12-25-2011 , 14:55   A couple of questions
Reply With Quote #1

1st question,
I'm trying to put it as spawning any monster(from monster_babycrab to monster_nihilanth, of course I wouldn't use nihilanth because... the server will crash) in sven coop, rather than using Engine to recreate them(create_entity). Since I don't think there is a command to spawn monsters in sven coop, would I just do create_entity "monster_barney"?

2nd question,
I'm trying to have 1 player heal other players within a 200 radius, and finding the players must have worked, but how would I use set_user_health? I've done it like this:

PHP Code:
new playergroup
new entlist[513];
playergroup=find_sphere_class(0,"player",200.0,entlist,512);
new 
playerheal=get_user_health(id)+(speed[id]/2)
set_user_health(playergroup,playerheal+25)
client_print(id,print_chat,"[HKXP]Healed players around you for %i.",playerheal
3rd question, *FIXED*
This one is fine, but I want it to tell the *correct* time, because it gives me a huge number like 1237469900 when it is really 6 or 7. I've written it like this:
PHP Code:
set_user_godmode(id1)
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
new 
tonegtime=2.0+(speed[id]/2)
set_task(tonegtime,"ToneGod",id)
client_print(id,print_chat,"[HKXP]Short Godmode On for %i.",tonegtime
How could I fix that?

4th question,
I'm having a skill cooldown timer but I don't believe its working. I've written it like this:
PHP Code:
public skillcooldown(id)
{
    if(
skillwait[id]>0)
    {
        
skillwait[id]=skillwait[id]-1
    
}
}

//Later on in another function..

set_task(1.0,"skillcooldown",60
I'm getting Index Out Of Bounds on if(skillwait[id]>0). How do I fix this?
__________________
I can't believe I wasted 5 years of my life not knowing how to program correctly. Went too deep into advanced coding before even learning the basics correctly. :c

Last edited by Mirun.Frontier; 12-25-2011 at 16:53.
Mirun.Frontier is offline
 


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 11:49.


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