Raised This Month: $ Target: $400
 0% 

Wont give item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
caked
Member
Join Date: Dec 2012
Old 11-03-2013 , 05:07   Wont give item
Reply With Quote #1

I am currently coding a mod on scoutzknivez but when I try to give item such as HE it is stripping is there a way I can make it, it doesn't cause scoutzknivez map don't let me give any weapons.
caked is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-03-2013 , 05:09   Re: Wont give item
Reply With Quote #2

Sorry, i haven't brought my crystal ball !!
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-03-2013 , 06:06   Re: Wont give item
Reply With Quote #3

you need to delay giving items if its on round start / round spawn.
__________________
Blizzard_87 is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-03-2013 , 06:10   Re: Wont give item
Reply With Quote #4

Quote:
Originally Posted by Blizzard_87 View Post
you need to delay giving items if its on round start / round spawn.
Or just remove the entity that strips player weapons and the entity which gives the weapons, then give the weapons manually using a plugin
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

new Trie:g_hClassNames
new g_iForward

public plugin_precache()
{
    new 
szMap[30]
    
get_mapname(szMapcharsmax(szMap))
    
    if(!
equali(szMap"scoutzknivez"))
    {
        
log_amx("Stopped plugin as map is not scoutzknivez")
        return;
    }
    
    
g_hClassNames TrieCreate()
    
    
TrieSetCell(g_hClassNames"game_player_equip"1)
    
TrieSetCell(g_hClassNames"player_weaponstrip"1)
    
    
g_iForward register_forward(FM_Spawn"fw_EntSpawn"0)
}

public 
fw_EntSpawn(iEnt)
{
    static 
szClassName[32]
    
pev(iEntpev_classnameszClassNamecharsmax(szClassName))
    
    if(
TrieKeyExists(g_hClassNamesszClassName))
    {
        
server_print("*** Ent Removed  %s ***"szClassName)
        
engfunc(EngFunc_RemoveEntityiEnt)
        return 
FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED
}

public 
plugin_init()
{
    
unregister_forward(FM_Spawng_iForward0)
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
}

public 
fw_PlayerSpawn(id)
{
    if(!
is_user_alive(id))
    {
        return;
    }
    
    
strip_user_weapons(id)
    
give_item(id"weapon_knife")
    
give_item(id"weapon_scout")
    
give_item(id"weapon_hegrenade")

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-03-2013 , 07:44   Re: Wont give item
Reply With Quote #5

If such entities exist, best (most efficient) is to make game_player_equip give a extra HE to players.

EDIT : Tested and works fine :
Spoiler


Tips :
amxmodx/configs/maps/plugins-scoutzknivez.ini :
Code:
scoutzknivez_he_giver.amxx
amxmodx/configs/maps/scoutzknivez.cfg :
Code:
sv_gravity 250
amxmodx/configs/amxx.cfg :
Code:
sv_gravity 800
Attached Files
File Type: sma Get Plugin or Get Source (scoutzknivez_he_giver.sma - 487 views - 332 Bytes)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-03-2013 at 07:58.
ConnorMcLeod is offline
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 23:15.


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