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

adding and removing time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 05-22-2012 , 13:39   adding and removing time
Reply With Quote #1

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()
    }

yamin is offline
Reply


Thread Tools
Display Modes

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 05:32.


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