Raised This Month: $ Target: $400
 0% 

Auto Respawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 07-30-2020 , 08:10   Re: Auto Respawn
Reply With Quote #6

Wouldn't it be better so register a join team logevent?

PHP Code:
#include <amxmodx>

#include <hamsandwich>

#pragma semicolon 1

#define IsPlayer(%1) (1<=%1<=32)
#define DELAY 1.0

public plugin_init(){
    
register_plugin("MY""NAME""JEFF");
    
    
register_logevent("JoinTeam"3"1=joined team");
    
RegisterHam(Ham_Killed"player""ham_PlayerKilledPost"1);
}

public 
JoinTeam(){
    new 
user[128], name[32];
    
read_logargv(0user127);
    
parse_loguser(username31);
    new 
id=get_user_index(name);
    
    if(!
IsPlayer(id))
        return;
        
    new 
temp[2];
    
read_logargv(2temp1);
    if(
temp[0]=='T')
        
set_task(DELAY+4.0"task_Respawn"id);
    
    else if(
temp[0]=='C')
        
set_task(DELAY+4.0"task_Respawn"id);
    
    return;
}

public 
ham_PlayerKilledPost(id){
    
set_task(DELAY"task_Respawn"id);
}

public 
task_Respawn(id){
    if(
get_user_team(id)!=3)
        
ExecuteHamB(Ham_CS_RoundRespawnid);


Last edited by Foxa; 07-30-2020 at 09:13.
Foxa is offline
 



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 09:01.


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