Raised This Month: $ Target: $400
 0% 

help with give item and restrict all weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lashsh
BANNED
Join Date: Jun 2010
Location: Georgia, Tbilisi
Old 08-09-2010 , 12:59   Re: help with give item and restrict all weapons
Reply With Quote #6

how register cvar from respawn time and respawn on or off? on this plugin

sorry my bad english

example

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

public plugin_init()
{
       
register_plugin("amx_respawn","1.0","GHW_Chronic")
    
register_event("DeathMsg","death_msg","a")
    
register_event("ShowMenu","team_select","b","4&Team_Select")
    
register_event("VGUIMenu","team_select","b","1=2")

    
register_cvar("respawn_on","0")
    
register_cvar("respawn_safetytime","3")

    
register_menucmd(register_menuid("Terrorist_Select",1), 511,"team_select")
    
register_menucmd(register_menuid("CT_Select",1),511,"team_select")
    
register_clcmd("joinclass","team_select")
}

public 
team_select(id)
{
    if(
get_cvar_num("amx_respawn")) 
    {
        
set_task(1.6,"respawn",id)
    }
}

public 
death_msg()
{
    new 
id=read_data(2)
    new 
team[32]
    
get_user_team(id,team,31)
    if(
get_cvar_num("amx_respawn") && containi(team,"spec")==-1)  
    {
        
spawn(id)
        
set_task(0.6,"respawn",id)
        
set_task(0.7,"respawn2",id)
    }
}

public 
respawn(id)
{
    
spawn(id)


public 
respawn2(id)
{
    
spawn(id)
    
set_user_health(id,230500)
    
set_task(get_cvar_float("amx_respawn_safetytime"),"health",id)
    
client_print(id,print_chat,"[AMXX] You are invincible for %d seconds.",get_cvar_num("amx_respawn_safetytime"))
    
set_user_rendering(id,kRenderFxGlowShell,0,255,0,kRenderTransAlpha,255)


public 
health(id)
{
    
set_user_health(id,100)
    
client_print(id,print_chat,"[AMXX] You are no longer invincible.")
    
set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,255)

Attached Files
File Type: sma Get Plugin or Get Source (knifemod.sma - 585 views - 2.8 KB)

Last edited by lashsh; 08-09-2010 at 13:40.
lashsh is offline
Send a message via Skype™ to lashsh
 



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 00:12.


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