Raised This Month: $ Target: $400
 0% 

Replace Smoke HUD


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
leonard19941
Veteran Member
Join Date: Jun 2011
Old 05-03-2012 , 23:12   Re: Replace Smoke HUD
Reply With Quote #10

no men, that was an example of god

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "1.1"

new g_iMsgWeaponList;

public 
plugin_init()
{
    
register_plugin("Replace Smoke HUD"VERSION"Kiske");
    
    
RegisterHam(Ham_Item_AddToPlayer"weapon_smokegrenade""fw_Smoke_AddToPlayer"1);
    
RegisterHam(Ham_Item_ItemSlot"weapon_smokegrenade""fw_Smoke_ItemSlot");

    
register_clcmd("weapon_bubble""SelectBubble");
    
    
g_iMsgWeaponList get_user_msgid("WeaponList");
}

public 
plugin_precache()
{
    new 
sFile[25];
    
formatex(sFilecharsmax(sFile), "sprites/weapon_bubble.txt");
    
    if(!
file_exists(sFile)) // create file
    
{
        new 
iFile fopen(sFile"wt");
        
        
fputs(iFile"3^n");
        
fputs(iFile"weapon 640 640hud19 0 0 170 45^n");
        
fputs(iFile"weapon_s 640 640hud20 0 0 170 45");
        
fputs(iFile"ammo 640 640hud19 192 112 49 16");
        
        
fclose(iFile);
    }
    
    
precache_generic(sFile);
    
precache_generic("sprites/640hud19.spr");
    
precache_generic("sprites/640hud20.spr");
}

public 
fw_Smoke_AddToPlayer(itemid)
{
    if(
pev_valid(item) && is_user_alive(id))
    {
        
message_begin(MSG_ONEg_iMsgWeaponList, .player id);
        {  
            
write_string("weapon_bubble"); // WeaponName
            
write_byte(13); // PrimaryAmmoID
            
write_byte(1); // PrimaryAmmoMaxAmount
            
write_byte(-1); // SecondaryAmmoID
            
write_byte(-1); // SecondaryAmmoMaxAmount
            
write_byte(3); // SlotID (0...N)
            
write_byte(3); // NumberInSlot (1...N)
            
write_byte(CSW_SMOKEGRENADE);  // WeaponID
            
write_byte(0);  // Flags
        
}
        
message_end();
    }
}

public 
fw_Smoke_ItemSlot(id)
{
    if(
is_user_alive(id))
    {
        
SetHamReturnInteger(4);
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
SelectBubble(id)
{
    if(
is_user_alive(id))
    {
        
engclient_cmd(id"weapon_smokegrenade");
    }
    
    return 
PLUGIN_HANDLED;


I know this data sprite:

640hud33.spr

Attached Thumbnails
Click image for larger version

Name:	sprites2.JPG
Views:	537
Size:	48.3 KB
ID:	103112  
__________________

Last edited by leonard19941; 05-03-2012 at 23:14.
leonard19941 is offline
 



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:30.


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