AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A couple of questions (https://forums.alliedmods.net/showthread.php?t=174802)

Mirun.Frontier 12-25-2011 14:55

A couple of questions
 
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?

Devil259 12-25-2011 15:58

Re: A couple of questions
 
3) client_print(id,print_chat,"[HKXP]Short Godmode On for %i.",tonegtime)

->

client_print(id,print_chat,"[HKXP]Short Godmode On for %0.f",tonegtime)


All times are GMT -4. The time now is 11:49.

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