AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   function give item() not working because another plugin (https://forums.alliedmods.net/showthread.php?t=320069)

HITLER 12-02-2019 20:57

function give item() not working because another plugin
 
i have 2 plugins
in first plugin it should give T team smokegernade but because a part of code in second plugin the somkegernade don't added to player.

here is the 2 codes.

first plugin
PHP Code:

give_item(id"weapon_smokegrenade"); 

second plugin
PHP Code:

RegisterHam(Ham_AddPlayerItem"player""CBasePlayer_AddPlayerItem");

public 
CBasePlayer_AddPlayerItem(idiWeapon
{
    if(
get_user_human(id))
        return 
HAM_IGNORED;
    
    if(
ExecuteHam(Ham_Item_GetWeaponPtriWeapon) != iWeapon || cs_get_weapon_id(iWeapon) == CSW_KNIFE)
        return 
HAM_IGNORED;
    
set_pev(idpev_viewmodel2g_zombie_hands_models[iClass[id]]);
    
set_pev(idpev_weaponmodel2"");
    
entity_set_int(iWeaponEV_INT_flagsentity_get_int(iWeaponEV_INT_flags) | FL_KILLME);
    
SetHamReturnInteger(0);
    return 
HAM_SUPERCEDE;


if i delete CBasePlayer_AddPlayerItem in second plugin everything works well.
i tried to edit the second code it works but set_pev(id, pev_viewmodel2, g_zombie_hands_models[iClass[id]]); is not working


All times are GMT -4. The time now is 00:53.

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