AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Godmode for (x) seconds. (https://forums.alliedmods.net/showthread.php?t=53624)

Dark Kingdom 04-07-2007 18:26

Godmode for (x) seconds.
 
The title says it all.
What would the code be to have godmode last for x amount of seconds?

Howdy! 04-07-2007 18:52

Re: Godmode for (x) seconds.
 
Syntax
set_user_godmode ( index, [ godmode = 0 ] )

and

set_task(15.0,"MyFunction")





regalis 04-07-2007 18:59

Re: Godmode for (x) seconds.
 
Is this what you looking for?
Code:

#include <fun>

#define GODTASK = 1977;
....
....

public Godmode(id)
{
      new godid = id + GODTASK;
      set_user_godmode (id, 1);
      set_task(Time_goes_here!, "removeGod", godid);
      return PLUGIN_CONTINUE;
}

public removeGod(god_id)
{
    new id = god_id - GODTASK;
    set_user_godmode(id);
}

greetz regalis


All times are GMT -4. The time now is 06:39.

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