Raised This Month: $ Target: $400
 0% 

weapon ammo


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LightScribe16
Junior Member
Join Date: Jul 2011
Old 07-27-2011 , 08:19   Re: weapon ammo
Reply With Quote #3

Quote:
Originally Posted by Aykay View Post
How are you calling give_stuff(id)?

Maybe you should put it in the CurWeapon event?
PHP Code:
RegisterHam(Ham_Spawn"player""give_stuff"1
Quote:
What's wrong with give_item()?
When someone die, grenades return, but with fm give item not so

Sorry for my bad language

Full code

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <amxmisc>
#include <fun>

#define PLUGIN_NAME "vipas"
#define PLUGIN_AUTHOR "Kukulis"
#define PLUGIN_VERSION "0.1"

static const COLOR[] = "^x04"
static const CONTACT[] = ""

new maxplayers
new gmsgSayText
new bool:HasC4[33]
#define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890

public plugin_init()
{
register_plugin(PLUGIN_NAMEPLUGIN_AUTHORPLUGIN_VERSION);

RegisterHam(Ham_Spawn"player""give_stuff"1)     
register_event("ResetHUD","event_reset_hud","be");
register_event"ResetHUD""ResetHUD""be" )
register_clcmd("say /vip","admin_motd",0,"- Shows the MOTD.")

register_clcmd("say""handle_say")
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
gmsgSayText get_user_msgid("SayText")

maxplayers get_maxplayers()

return 
PLUGIN_CONTINUE

}



public 
event_reset_hud(id)
{
if(!
is_user_connected(id))
return 
PLUGIN_CONTINUE;

client_print(idprint_chat"[VIP] Write /vip To see the VIP privileges.")

if(!
access(id,ADMIN_CVAR))
return 
PLUGIN_CONTINUE;

set_task(1.0,"give_stuff",id);

return 
PLUGIN_CONTINUE;
}

public 
admin_motd(id,level,cid) {

    if (!
cmd_access(id,level,cid,1))
    return 
PLUGIN_CONTINUE
    
    show_motd
(id,"vip.txt","VIP by Kukulis")
    return 
PLUGIN_CONTINUE   
}




public 
give_stuff(id)
{
if(!
is_user_alive(id)) return PLUGIN_HANDLED
 
    else if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
    
   
fm_give_item(id"item_assaultsuit");
   
fm_give_item(id"weapon_flashbang");
   
fm_give_item(id"weapon_flashbang");
   
fm_give_item(id"weapon_hegrenade");
   
fm_give_item(id"weapon_smokegrenade");
   
set_user_gravity (id0.75);
   
cs_set_weapon_ammo(fm_give_itemid"weapon_scout" ), 0);
   
cs_set_user_bpammo(idCSW_SCOUT0);
   
   return 
PLUGIN_CONTINUE
         
}
    
}

public 
handle_say(id)
{
    new 
said[192]
    
read_args(said,192)
    if(( 
containi(said"who") != -&& containi(said"admin") != -1) || contain(said"/vips") != -1)
        
set_task(0.1,"print_viplist"id)
    return 
PLUGIN_CONTINUE
}

public 
print_viplist(user
{
    new 
adminnames[33][32]
    new 
message[256]
    new 
contactinfo[256], contact[112]
    new 
idcountxlen
    
    
for(id id <= maxplayers id++)
        if(
is_user_connected(id))
            if(
get_user_flags(id) & ADMIN_CVAR)
                
get_user_name(idadminnames[count++], 31)

    
len format(message255"%s Online VIP: ",COLOR)
    if(
count 0) {
        for(
count x++) {
            
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
            if(
len 96 ) {
                
print_message(usermessage)
                
len format(message255"%s ",COLOR)
            }
        }
        
print_message(usermessage)
    }
    else {
        
len += format(message[len], 255-len"No online VIP.")
        
print_message(usermessage)
    }

    
get_cvar_string("amx_contactinfo"contact63)
    if(
contact[0])  {
        
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
        
print_message(usercontactinfo)
    }
}

print_message(idmsg[])
{
    
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()
}

public 
ResetHUDid )
{
    
set_task0.5"VIP"id 6910 )

    if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
        {
            
HasC4[id] = true;
            
set_task0.5"Bomb"id 6910 )
        }
}

public 
VIPTaskIDid )
{
    new 
id TaskID 6910

    
if ( get_user_flagsid ) & ADMIN_LEVEL_H 
    {
        
message_beginMSG_ALLget_user_msgid"ScoreAttrib" ) )
        
write_byteid )
        
write_byte)
        
message_end( )
    }

    return 
PLUGIN_HANDLED


Last edited by LightScribe16; 07-27-2011 at 08:33.
LightScribe16 is offline
Send a message via Skype™ to LightScribe16
 



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


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