Hey guys i want a plugin that drop the same weapon after buy from buy extra item for example if i buy frost M4A1 then fire m4a1 the weapon mixed instead of drop
If anyone know how to fix this pls help me thanks. Btw sorry for my bad English
that won't solve your issuee. you need to remove the bool/variable of the old item as well as dropping the weapon. you might not even need to drop the weapon lol.
that won't solve your issuee. you need to remove the bool/variable of the old item as well as dropping the weapon. you might not even need to drop the weapon lol.
Can you show me a example? So i can do that in every items.
that won't solve your issuee. you need to remove the bool/variable of the old item as well as dropping the weapon. you might not even need to drop the weapon lol.
Can you show me a example? So i can do that in every items.
Let's say you have a golden m4a1 and a silver m4a1, each weapon has a bool like this one: new bool:g_HasM4[33]
when a player buys the weapon the bool is set to true and it means the player has the weapon. when you drop it or buy a new weapon the bool stays true, what you want to do is to set the bool to false when it drops or when the player buys new item. For example this is the golden m4: public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You bought Golden M4A1")
g_HasM4[player] = true;
}
}
This is the silver m4: public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You bought Silver M4A1")
g_HasM4[player] = true;
}
}If you want the items not to interact with each other you need to create a native for each. golden m4: public plugin_natives()
g_HasM4[id] = false; Now that both items got natives to remove them you can use those natives to remove the item. for golden m4, under the global variables you add the silver m4 native like this. native zp_remove_silver_m4(id)for the silver m4 under the g variables you add the golden m4 native like this. native zp_remove_golden_m4(id)now you use the native in the zp_extra_item_selected so it will be like this for the golden m4: public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
zp_remove_silver_m4(player)
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You bought Golden M4A1")
g_HasM4[player] = true;
}
} silver m4: public zp_extra_item_selected(player, itemid)
{
if ( itemid == g_itemid )
{
if ( user_has_weapon(player, CSW_M4A1) )
{
drop_prim(player)
}
zp_remove_golden_m4(player)
give_item(player, "weapon_m4a1")
client_print(player, print_chat, "[ZP] You bought Silver M4A1")