AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   adding and removing time (https://forums.alliedmods.net/showthread.php?t=185867)

yamin 05-22-2012 13:39

adding and removing time
 
i need to do if anyone knives the person who activates will get 100 minutes and the person who get knifed will lose 300
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

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

new g_curwep,soloid
new bool:lock,bool:solorun

public plugin_init() {
    
register_concmd("amx_solo""admin_solo"ADMIN_MAP)
    
register_clcmd("usp","HandleCmd")
    
    
register_event("CurWeapon","fw_CurWeapon","b","1=1")
    
g_curwep get_user_msgid("CurWeapon")
    
    
register_logevent("fw_RoundEnd",2,"1=Round_End")
}

public 
admin_solo(id,level,cid
{
    if(
lock||solorun)
        return
    
    
solorun true
    lock 
true
    soloid 
id
    
    console_print
(id"You have activated Solo Gunner Mode")
    
    if (
get_user_flags(id) & ADMIN_BAN)
    {
        
give_item(id"usp")
        new 
name [32]
        
get_user_name(id,name,31)
        
client_print(0,print_chat,"*** Solo Gunner is activated by Admin %s.",name)
    }
    if (
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
give_item(id"usp")
        new 
name [32]
        
get_user_name(id,name,31)
        
client_print(0,print_chat,"*** Solo Gunner is activated by Golden Player %s",name)
    }
    if (
get_user_flags(id) & ADMIN_LEVEL_G)
    {
        
give_item(id"usp")
        new 
name [32]
        
get_user_name(id,name,31)
        
client_print(0,print_chat,"*** Solo Gunner is activated by Silver Player %s",name)
    }
}

public 
fw_RoundEnd(){
    if(
solorun)
        
solorun false
}

public 
fw_CurWeapon(id){
    if (!
is_user_alive(id))
        return
        
    if(!
solorun)
        return
    
    if (
id!=soloid&&!((1<<read_data(2))&(1<<CSW_KNIFE))){
        
engclient_cmd(id"weapon_knife")
        
emessage_begin(MSG_ONE,g_curwep,_,id)
        
ewrite_byte(1)
        
ewrite_byte(CSW_KNIFE)
        
ewrite_byte(-1)
        
emessage_end()
    }else if(
id==soloid&&!((1<<read_data(2))&(1<<CSW_USP))){
        
engclient_cmd(id"weapon_knife")
        
emessage_begin(MSG_ONE,g_curwep,_,id)
        
ewrite_byte(1)
        
ewrite_byte(CSW_USP)
        
ewrite_byte(-1)
        
emessage_end()
    }




All times are GMT -4. The time now is 08:14.

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