Raised This Month: $ Target: $400
 0% 

revive any player saying /revive


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 06-05-2009 , 09:07   revive any player saying /revive
Reply With Quote #1

Hey i was just looking though some topics and found a code (cant find it right now X)) anyways im trying to make so anyone that says /revive (if hes dead not if hes alive or spectator) gets revived.

Thanks in advanced
micke1101 is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-05-2009 , 09:42   Re: revive any player saying /revive
Reply With Quote #2

well you could check for player to be alive like this
Quote:
if(!is_user_alive(id))
then you use command to revive the user that called the comand
(i assume you found that one)
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com
Atspulgs is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-05-2009 , 09:43   Re: revive any player saying /revive
Reply With Quote #3

Wait i can help you
zacky is offline
Send a message via Skype™ to zacky
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-05-2009 , 09:45   Re: revive any player saying /revive
Reply With Quote #4

Is it for CS?
Code:
#include <amxmodx> #include <hamsandwich>   public plugin_init()         register_clcmd("say /revive", "cmdSayRevive");   public cmdSayRevive(iCl)         if (!is_user_alive(iCl))                 ExecuteHamB(Ham_CS_RoundRespawn, iCl);
__________________
hleV is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 06-05-2009 , 09:49   Re: revive any player saying /revive
Reply With Quote #5

Yes thanks hleV
(lol that was a small code XD)
micke1101 is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-05-2009 , 09:52   Re: revive any player saying /revive
Reply With Quote #6

haha, i thought you meant revive another player ^^

Well, if you want to respawn another player use this:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""cmdHookSay");
}

public 
cmdHookSay(id) {
    new 
iArgs[38], iArg1[6], iArg2[33];
    
read_argsiArgs37 );
    
remove_quotesiArgs );
    
    if( 
containi(iArgs"revive") == -&& iArgs[0] != '/' )
        return 
PLUGIN_CONTINUE;
    
    
parseiArgsiArg15iArg232 );
    
    if( 
equali(iArg1"/revive"5) && get_user_flags(id) & ADMIN_CHAT ) {
        new 
iPlayer cmd_targetidiArg2);
            
        if( 
iPlayer ) {
            if (!
is_user_alive(iPlayer) && cs_get_user_team(id) != CS_TEAM_SPECTATOR ) {
                new 
szAdminName[32], szPlayerName[32];
                
                
get_user_name(idszAdminName31);
                
get_user_name(iPlayerszPlayerName31);
                
                
ExecuteHam(Ham_CS_RoundRespawnid);
                
client_print(iPlayerprint_chat"ADMIN %s revived you"szAdminName);
                
client_print(idprint_chat"You revived %s"szPlayerName);
            }
        }
        else if( !
equal(iArg2"") )
            
client_print(idprint_chat"Failed to find player named %s."iArg2);
        else if( 
equal(iArg2"") )
            
client_print(idprint_chat"Usage: /revive <nick>");
    }
    
    return 
PLUGIN_CONTINUE;

Usage:
Say in chat: /revive name

Last edited by zacky; 06-05-2009 at 09:57.
zacky is offline
Send a message via Skype™ to zacky
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-05-2009 , 09:56   Re: revive any player saying /revive
Reply With Quote #7

I forgot to check if player is not spectator. Not sure if Ham_CS_RoundRespawn works on spectators though.
__________________
hleV is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-05-2009 , 09:58   Re: revive any player saying /revive
Reply With Quote #8

Question, why did you use ExecuteHamB and not ExecuteHam?
zacky is offline
Send a message via Skype™ to zacky
Atspulgs
Senior Member
Join Date: Mar 2008
Old 06-05-2009 , 11:53   Re: revive any player saying /revive
Reply With Quote #9

do you need to check spec? is spec ever considered alive?
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com
Atspulgs is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-05-2009 , 12:54   Re: revive any player saying /revive
Reply With Quote #10

Quote:
Originally Posted by Atspulgs View Post
do you need to check spec? is spec ever considered alive?
In my code you can only respawn, if YOU'RE DEAD. All spectators ARE DEAD. So I wonder if Ham_CS_RoundRespawn allows spectator to respawn.
__________________
hleV 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 14:02.


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