Raised This Month: $51 Target: $400
 12% 

Revive


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Churchboy587
BANNED
Join Date: Oct 2008
Old 10-26-2008 , 13:46   Revive
Reply With Quote #1

I need a simple command that will revive an admin.
He can only revive once a round.
Please do this for me! THANKS!
Churchboy587 is offline
PrEn1umz
Junior Member
Join Date: Feb 2007
Location: Nice, France
Old 10-26-2008 , 14:25   Re: Revive
Reply With Quote #2

not tested

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <fun>

new bool:g_Allowed[33];

new 
pCVAR_autospawn;

public 
plugin_init()
{
    
register_plugin("Admin Death Respawn""0.1.a""PrEn1umz");
    
    
register_event("DeathMsg""Event_DeathMsg""a");
    
register_event("HLTV""Event_NewRound""a""1=0""2=0");
    
    
register_forward(FM_ClientPutInServer"Forward_PutInServer");
    
    
pCVAR_autospawn register_cvar("amxx_autospawn""1");
}

public 
Forward_PutInServer(id)
{
    
g_Allowed[id] = true;
}

public 
Event_NewRound()
{
    for (new 
033; ++ i)
    {
        
g_Allowed[i] = true;
    }
}

public 
Event_DeathMsg()
{
    if (
get_pcvar_num(pCVAR_autospawn))
    {
        new 
id read_data(2);
        
        
set_task(0.5"Task_Respawn"id 123);
    }
}

public 
Task_Respawn(TaskID)

    new 
id TaskID 123;
    
    if (
get_user_team(id) != || is_user_alive(id) || !g_Allowed[id])
    {
        return 
PLUGIN_CONTINUE;
    }
    if (
get_user_flags(idADMIN_ALL))
    {
        
g_Allowed[id] = false;
        
        
spawn(id);
        
        return 
PLUGIN_CONTINUE;
    }
    
    return 
PLUGIN_CONTINUE;

PrEn1umz is offline
Churchboy587
BANNED
Join Date: Oct 2008
Old 10-26-2008 , 16:56   Re: Revive
Reply With Quote #3

It compiles yay!
Attached Files
File Type: sma Get Plugin or Get Source (Revive.sma - 476 views - 1.4 KB)
Churchboy587 is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 10-26-2008 , 19:12   Re: Revive
Reply With Quote #4

Code:
if( get_user_team != 2...)

fix --->

if( get_user_team != 3...)

// 2 = CT, 1 = T, 3 = SPECTATOR
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
PrEn1umz
Junior Member
Join Date: Feb 2007
Location: Nice, France
Old 10-27-2008 , 15:00   Re: Revive
Reply With Quote #5

Quote:
Originally Posted by Dores View Post
Code:
if( get_user_team != 2...)

fix --->

if( get_user_team != 3...)

// 2 = CT, 1 = T, 3 = SPECTATOR
oups litle error Thx !
PrEn1umz is offline
Reply



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 15:36.


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