Raised This Month: $51 Target: $400
 12% 

GunXp special weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
benqcon
Member
Join Date: Jul 2020
Old 04-04-2024 , 13:51   GunXp special weapons
Reply With Quote #1

Hello modders! I hope all is well with you. I need assistance in my Gun Xp mod. As you may know, this mod lets the player receive new weapons with each level they complete, however it only unlocks default CS1.6 weapons.
My issue is that I'm not sure how to add unique weapons (from a different plugin) to the list of weapons that can be unlocked.

So please, help me.
benqcon is offline
Vaflyan
Junior Member
Join Date: Mar 2024
Old 04-06-2024 , 06:32   Re: GunXp special weapons
Reply With Quote #2

Have you tried native output?
Vaflyan is offline
benqcon
Member
Join Date: Jul 2020
Old 04-06-2024 , 14:47   Re: GunXp special weapons
Reply With Quote #3

So what I tried is this:
First I added these line to the weapon from other plugin:
Quote:
public plugin_natives()
{
register_native("give_dual_uzi", "native_give_dual_uzi", 1)
}

public native_give_dual_uzi(id)
{
Set_BitVar(g_Had_Base, id)
give_item(id, weapon_base)
cs_set_user_bpammo(id, CSW_BASE, 400)
}
and then I try to call it in the main gunxp mod with this:
Quote:
if (PlayerLevel[id] == MAXLEVEL2 - 1) // Assuming the last level is MAXLEVEL2 - 1
{
// Call the native function from the "Dual_Uzi.amxx" plugin to give the player the special weapon
if (callfunc_begin("native_give_dual_uzi", "Dual_Uzi.amxx") == 1)
{
callfunc_push_int(id);
callfunc_end();
}
}
else if (PlayerLevel[id] >= 20) // Unlock the Dual Uzi at level 20
{
// Call the native function from the "Dual_Uzi.amxx" plugin to give the player the special weapon
if (callfunc_begin("native_give_dual_uzi", "Dual_Uzi.amxx") == 1)
{
callfunc_push_int(id);
callfunc_end();
}
}
it worked but not perfectly, There are some bugs:

1- The special weapon (Dual_Uzi) didn't show up in the menu

2- when I choose any weapon I also get the special one, so now I have two guns + the pistol
benqcon is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:41.


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