Hi guys, I've been looking into netprops but uh I can't seem to figure this out. I want to remove someone's clip and reserve ammo on a weapon, but I've been only lucky with the clip.. Any thoughts/help? Thanks
My code:
PHP Code:
stock SetReserveAmmo(client, ammo)
{
new weapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
if(weapon < 1) return;
new ammotype = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType");
if(ammotype == -1) return;
SetEntProp(client, Prop_Send, "m_iAmmo", ammo, _, ammotype);
PrintToChatAll("ammo: %i", ammo); // it does parse 0...
}
public Action:SomeFunction(client, args)
{
new Primary = GetPlayerWeaponSlot(client, 0);
//new Secondary = GetPlayerWeaponSlot(client, 1);
new String:pc[32] = "null";
//new String:sc[32] = "null";
GetEdictClassname(Primary, pc, sizeof(pc));
Client_SetWeaponClipAmmo(client, pc, 0, 0);
SetReserveAmmo(client, 0);
}
AND yes I also tried smlibs one, again doesn't seem to work!! welpp
__________________