Raised This Month: $ Target: $400
 0% 

help with grenades + kevlar + deagle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-17-2013 , 04:34   help with grenades + kevlar + deagle
Reply With Quote #1

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

public plugin_init()
{
    
register_plugin("Admins are VIP's + grenades + kevlar""1.0""Eg@r4$il{")
    
register_event("ResetHUD""ResetHUD""be")
}

public 
ResetHUD(id)
{
    
set_task(0.5"VIP"id 6910)
}

public 
VIP(TaskID)
{
    new 
id TaskID 6910
    
    
if (is_user_admin(id))
    {
        
message_begin(MSG_ALLget_user_msgid("ScoreAttrib"))
        
write_byte(id)
        
write_byte(4)
        
message_end()
        
give_item(id,"weapon_hegrenade")
        
give_item(id,"weapon_flashbang")
        
give_item(id,"weapon_flashbang")
        
give_item(id,"weapon_smokegrenade")
        
give_item(id,"item_assaultsuit")
        
give_item(id"weapon_deagle")    
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
        
give_item(id"ammo_50ae")
    }
    
    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
Help. how to avoid usp/glock at the round start? i would like to have deagle straight away. Can someone help me with it?
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-17-2013 , 05:00   Re: help with grenades + kevlar + deagle
Reply With Quote #2

You could set m_iDefaultItems, or you could use strip_user_weapons() - but not in ResetHUD message - this message is more complex than you think - you should really use Ham_Spawn, not only is it easier it's more efficient.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 04-17-2013 , 05:01   Re: help with grenades + kevlar + deagle
Reply With Quote #3

Take a look here. This should help you.
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-17-2013 , 13:54   Re: help with grenades + kevlar + deagle
Reply With Quote #4

Try this :

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

#tryinclude <cstrike_pdatas>

#if !defined _cbaseentity_included
        #assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \
                
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101   \
                
2. Put it into amxmodx/scripting/include/ folder   \
                
3. Compile this plugin locallydetailswiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29   \
                
4. Install compiled plugindetailswiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing
#endif

enum scoreAttribFlags ( <<= ) {
    
SA_NONE 0,
    
SA_DEAD 1,
    
SA_BOMB,
    
SA_VIP
}

const 
WEAPON_SUIT 31

public plugin_init()
{
    
register_plugin("Admins are VIP's + grenades + kevlar""2.0""Eg@r4$il{")
    
RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn")
    
RegisterHam(Ham_Spawn"player""OnCBasePlayer_Spawn_Post"true)
}

public 
OnCBasePlayer_Spawnid )
{
    if( 
pev_valid(id) == && (CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT) && is_user_admin(id) )
    {
        
set_pdata_bool(idm_bHasReceivedDefItemstrue)
    }
}

public 
OnCBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) && is_user_admin(id) )
    {
        
Util_ScoreAttrib(0idSA_VIP)

        
give_item(id"weapon_knife")
        
give_item(id"item_assaultsuit")
        
give_item(id"weapon_deagle")
        
ExecuteHam(Ham_GiveAmmoid70"50AE"70)
        
give_item(id"item_suit")
    }
}

Util_ScoreAttrib(idtargetflags)
{
    static 
msgScoreAttrib 0;
    if( !
msgScoreAttrib )
    {
        
msgScoreAttrib get_user_msgid("ScoreAttrib");
    }

    
message_begin(id MSG_ONE MSG_ALLmsgScoreAttrib_id);
    
write_byte(target);
    
write_byte(flags);
    
message_end();

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-21-2013 at 15:32.
ConnorMcLeod is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-21-2013 , 14:21   Re: help with grenades + kevlar + deagle
Reply With Quote #5

make it for me somebody please, i didn't get it how to make it simple way..
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 04-21-2013 , 14:26   Re: help with grenades + kevlar + deagle
Reply With Quote #6

What's the problem?

I've posted a link with an answer you can easily edit by yourself and Connor has given you a full example based on pdatas.
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015

Last edited by Leon M.; 04-21-2013 at 14:27.
Leon M. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-21-2013 , 15:26   Re: help with grenades + kevlar + deagle
Reply With Quote #7

Just noticed that m_iHideHUD pdata is updated right when suit is given.
Touch code is like this :
Spoiler



So it should be better to directly send give_item(id, "item_suit") but after player has received his weapons (previous post code edited).


If you don't want to bother to figure out if player already has weapons or not, you can use that function :
Spoiler
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-21-2013 at 15:33.
ConnorMcLeod is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 04-21-2013 , 16:58   Re: help with grenades + kevlar + deagle
Reply With Quote #8

PHP Code:
    static msgScoreAttrib 0;
    if( !
msgScoreAttrib )
    {
        
msgScoreAttrib get_user_msgid("ScoreAttrib");
    } 
Connor,why this is not registered inside plugin init ?
__________________

Last edited by Bos93; 04-21-2013 at 16:59.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-21-2013 , 17:10   Re: help with grenades + kevlar + deagle
Reply With Quote #9

Because i have a file with all messages stocks like this one, was lazy to put it in plugin_init, anyway it gonna be executed only once, it doesn't hurt.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-21-2013 at 17:10.
ConnorMcLeod is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-21-2013 , 17:15   Re: help with grenades + kevlar + deagle
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod
Try this
Works fine but has couple wierd things:
  • When i entered the game i have this view on photo
  • When i chose class and start to play welcome motd appears and then i close it and all seems to be fine.
Photo is here http://firepic.org/images/2013-04/22/3xu8ct2nhey0.jpg

Last edited by TRUE RED; 04-21-2013 at 17:18.
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Reply



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 10:46.


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