Hej, mam problem z funkcją cs_set_user_plant chcę pozbyć się modułu engine i cstrike z kodu poniżej:
public Fwd_AddPlayerItemPre(id,iWeaponID)
{
if(CheckBit(g_bAlive,id))
{
if(cs_get_weapon_id(iWeaponID) == CSW_C4)
{
entity_set_int(iWeaponID,EV_INT_flags,entity_get_int(id,EV_INT_flags) | FL_KILLME)
cs_set_user_plant(id,0,0)
entity_set_int(id,EV_INT_body,0)
SetHamReturnInteger(0)
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}
Myślałem, że zrobię to tak:
public Fwd_AddPlayerItemPre(id,iWeaponID)
{
if(CheckBit(g_bAlive,id))
{
if(cs_get_weapon_id(iWeaponID) == CSW_C4)
{
set_pev(iWeaponID, pev_flags, pev(id, pev_flags) | FL_KILLME)
cs_set_user_plant(id,0,0)
set_pev(id, pev_body, 0)
SetHamReturnInteger(0)
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}
Ale nie wiem jak zamienić cs_set_user_plant, moduł cstrike jest mi zbędny. Alternatywnie moge zrobić to naprzykład tak, ale wolałbym jakoś zmienić cs_set_user_plant
public fm_strip_c4() //Usuwanie C4
{
for ( new i = 1; i <= g_iMaxPlayers; ++i )
engclient_cmd(i, "drop", "weapon_c4"); //Wyrzuc C4
new weapbox, bomb = fm_find_ent_by_class(-1, "weapon_c4");
if (bomb && (weapbox = pev(bomb, pev_owner)) > g_iMaxPlayers)
{
dllfunc(DLLFunc_Think, weapbox); // Usuwa weaponbox + weapon_c4 entity pair
message_begin(MSG_ALL, get_user_msgid("BombPickup")); //Usuwanie czerwonego punkciku z radaru
message_end();
}
}


Dodatki SourceMod



Temat jest zamknięty










