Quote:
Originally Posted by bl4nk
Try this.
PHP Code:
// Global scope new Handle:g_hDropWeapon;
public OnPluginStart() { StartPrepSDKCall(SDKCall_Player); if (!PrepSDKCall_SetSignature(SDKLibrary_Server, "\x2A\x2A\x2A\x2A\x2A\x2A\x53\x55\x56\x57\x8B\xBC\x24\x40\x01\x00\x00\x32\xDB\x85\xFF\x8B\xF1\x0F", 24)) { PrepSDKCall_SetSignature(SDKLibrary_Server, "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb", 0); } PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer); PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain); PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain); g_hDropWeapon = EndPrepSDKCall(); }
// In your function new ent; if ((ent = GetPlayerWeaponSlot(target, slot)) != -1) { SDKCall(g_hDropWeapon, target, ent, false, false); }
|
That works great! My server is Linux, so it should work for windows as well. Thanks!
@Greyscale: My solution worked, too. Only problem is, the dropped weapon is a new one (no silencer/full ammo), not the weapon the player used before. Weapons given by GivePlayerItem do always have full ammo.