AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Wont give item (https://forums.alliedmods.net/showthread.php?t=229194)

caked 11-03-2013 05:07

Wont give item
 
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.

ConnorMcLeod 11-03-2013 05:09

Re: Wont give item
 
Sorry, i haven't brought my crystal ball !!

Blizzard_87 11-03-2013 06:06

Re: Wont give item
 
you need to delay giving items if its on round start / round spawn.

pokemonmaster 11-03-2013 06:10

Re: Wont give item
 
Quote:

Originally Posted by Blizzard_87 (Post 2056347)
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")



ConnorMcLeod 11-03-2013 07:44

Re: Wont give item
 
1 Attachment(s)
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


All times are GMT -4. The time now is 23:15.

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