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

request auto revive with no wopen


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-04-2017 , 13:52   Re: request auto revive with no wopen
Reply With Quote #11

Dude, it's called a WEAPON, not a "wopen".

PHP Code:
#include <amxmisc> 
#include <fun> 
#include <hamsandwich> 
#include <stripweapons> 

new bool:bla[33]

public 
plugin_init() { 
    
register_event("DeathMsg""Death""a")
    
RegisterHam(Ham_Spawn"player""Spawn"1)
}

public 
client_putinserver(id) {
    
bla[id] = false
}

public 
Spawn(id) {
    if(
is_user_alive(id) && bla[id]) {
        
StripWeapons(idSecondary)
        
bla[id] = false
    
}
}

public 
Death() {
    new 
menu menu_create("Respawn?""Handle"
    
menu_additem(menu"Yes.""1"
    
menu_additem(menu"No.""2"
    
menu_display(read_data(2), menu
    return 
PLUGIN_HANDLED 
}

public 
Handle(idmenuitem) { 
    new 
szData[7], szName[64], accesscallback 
    menu_item_getinfo
(menuitemaccessszData6szName63callback
    switch(
str_to_num(szData)) 
    { 
        case 
1: { bla[id] = trueExecuteHamB(Ham_CS_RoundRespawnid); }
        case 
2: return PLUGIN_HANDLED 
    

    return 
PLUGIN_HANDLED 

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Amine Belokda
Senior Member
Join Date: Oct 2015
Location: ML_NOT_FOUND
Old 05-04-2017 , 14:09   Re: request auto revive with no wopen
Reply With Quote #12

Edit This
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

new g_counter  

new g_SyncRestartTimer
new g_SyncGameStart

new Float:RoundStartTime

new g_Time_Interval;
const 
MAX_PLAYERS 32;

new 
g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
new 
g_pCvarRespawnTimeg_pCvarRespawnDelayg_pCvarMaxHealth;

public 
plugin_init()
{
    
register_plugin("Auto Respawn""1.0""Amine Belokda"); 
    
RegisterHam(Ham_Killed"player""fwdPlayerKilledPost"1); // Player Killed
    
RegisterHam(Ham_Spawn"player""fwdPlayerSpawnPost"1); // Player Spawned
    
register_event("TeamInfo""eTeamInfo""a"); // Team Info
    
register_logevent"LogEventRoundStart"2"1=Round_Start" // Round Start
    
g_pCvarRespawnTime register_cvar("amx_respawn_tickets""5"); // 0 = Unlimited Respawn 
    
g_pCvarRespawnDelay register_cvar("amx_respawn_delay""1"); // Delay to respawn
    
g_pCvarMaxHealth register_cvar("amx_max_health""100"); // Health on respawn
    
g_Time_Interval register_cvar("amx_max_time""5"); // Time Left to respawn
    
set_msg_blockget_user_msgid"ClCorpse" ), BLOCK_SET );
    
    
g_SyncRestartTimer CreateHudSyncObj()
    
g_SyncGameStart CreateHudSyncObj()
    
}

public 
LogEventRoundStart()
{
    
RoundStartTime get_gametime()
    
    new 
iPlayers[32]
    new 
iNum
    
    get_players
iPlayersiNum )
    
    for( new 
0iNumi++ )
    {
        
g_iRespawn[iPlayers[i]] = true
    
}
    
set_task(1.0,"TimeCounter",123456,_,_,"a",get_pcvar_num(g_Time_Interval))
    
set_task(get_pcvar_float(g_Time_Interval),"Runda_Terminata",789123)
}

public 
Runda_Terminata()
{
    if(
RoundStartTime)
    {
        
set_hudmessage255000.090.0010.51.00.515.0, -1)
        
ShowSyncHudMsg0g_SyncGameStart"Respawn plugin is disabled!")
    }
}

public 
fwdPlayerKilledPost(iVictimiKilleriShoudlGib)
{
    if(
g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
    {
        
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer"iVictim);
    }
    return 
HAM_IGNORED;
}

public 
fwdPlayerSpawnPost(iClient)
{
    if(
is_user_alive(iClient))
    {
        
set_pev(iClientpev_healthget_pcvar_float(g_pCvarMaxHealth));
    }
}

public 
taskRespawnPlayer(id)
{
    if(
is_user_connected(id) && RoundStartTime get_pcvar_num(g_Time_Interval) >= get_gametime() && g_iRespawn[id] && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
        
ExecuteHamB(Ham_CS_RoundRespawnid)
        
g_iRespawn[id] = false
        
return PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}  

public 
eTeamInfo() 

    new 
iClient read_data(1);
    new 
szTeam[2];
    
read_data(2szTeamcharsmax(szTeam));
    switch(
szTeam[0])
    {
        case 
'T'
        {
            if(
g_TeamInfoCounter[iClient] == || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
            {
                
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
            }
            
g_iPlayerTeam[iClient] = CS_TEAM_T;
        }
        case 
'C'
        {
            if(
g_TeamInfoCounter[iClient] == || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
            {
                
set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
            }
            
g_iPlayerTeam[iClient] = CS_TEAM_CT;
        }
        case 
'S':
        {
            
remove_task(iClient);
            
g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
        }
    }
}

public 
TimeCounter() 
{
    
g_counter++
    
    new 
Float:iRestartTime get_pcvar_float(g_Time_Interval) - g_counter
    
new Float:fSec
    fSec 
iRestartTime 
    
    set_hudmessage
255000.090.010.01.00.00.0, -1)
    
ShowSyncHudMsg0g_SyncRestartTimer"Remaining %d seconds of respawn "floatround(fSec))
    
    if(
get_pcvar_num(g_Time_Interval) - g_counter 11 && get_pcvar_num(g_Time_Interval) - g_counter !=0)
    {
        static 
szNum[32]
        
num_to_word(get_pcvar_num(g_Time_Interval) - g_counterszNum31)
    }
    if(
g_counter == get_pcvar_num(g_Time_Interval))
    {
        
g_counter 0
    
}

__________________
Amine Belokda is offline
Send a message via MSN to Amine Belokda
Crazy47
BANNED
Join Date: Jan 2016
Old 05-05-2017 , 13:28   Re: request auto revive with no wopen
Reply With Quote #13

Problem Solved thank's
Crazy47 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 21:14.


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