Raised This Month: $ Target: $400
 0% 

Solved [Help] Drop weapon if user is under level 10


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 05-11-2020 , 21:08   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #1

Quote:
Originally Posted by Bugsy View Post
Do you have an array that stores weapon levels?
Yes, i do have the array that stores weapons in the weapon menu + levels which for me it was a pain in the ass cause im an amature


HTML Code:
if (zp_get_user_level(id) < ArrayGetCell(i_lvl , ItemId))
	{
		Show_MainEquipMenu(id)
		client_printc(id , "%L" , id , "ZX_NOT_AT_LVL")
		return ITEM_DISABLED
	} //this is the array that i use in the main weapon plugin

Last edited by elmedin; 05-11-2020 at 21:21.
elmedin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2020 , 11:28   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #2

Are i_lvl and ItemId global variables? I need more code than that if you want help.
__________________
Bugsy is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 05-12-2020 , 13:15   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Are i_lvl and ItemId global variables? I need more code than that if you want help.
I would send you the whole weapon code, but i kinda worked so hard on this for days and i dont like giving it away to others :S
elmedin is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 05-12-2020 , 13:17   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #4

But also, i_lvl is talking about the weapon level, and itemid its about the weapon id, which i used them in the main core so when i try to add levels to each weapon it would be very easy

Last edited by elmedin; 05-12-2020 at 13:20.
elmedin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2020 , 13:21   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #5

If you wrote this plugin yourself, you should have no problem incorporating my code.
__________________
Bugsy is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 05-12-2020 , 13:22   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
If you wrote this plugin yourself, you should have no problem incorporating my code.
I didnt write the whole plugin myself, i only wrote the level system in it :S

Last edited by elmedin; 05-12-2020 at 13:23.
elmedin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2020 , 13:29   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #7

I think my above code makes it pretty clear how to make it work. So i_lvl is a global array handle?

PHP Code:
public get_user_levelid )
{
    return 
zp_get_user_levelid );
}

public 
get_weapon_leveliCSWeaponIndex )
{
    
//iCSWeaponIndex holds CSW_ weapon index.

    
return ArrayGetCelli_lvl iCSWeaponIndex );

__________________
Bugsy is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 05-13-2020 , 01:23   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
I think my above code makes it pretty clear how to make it work. So i_lvl is a global array handle?

PHP Code:
public get_user_levelid )
{
    return 
zp_get_user_levelid );
}

public 
get_weapon_leveliCSWeaponIndex )
{
    
//iCSWeaponIndex holds CSW_ weapon index.

    
return ArrayGetCelli_lvl iCSWeaponIndex );

Yes it is and its working
elmedin is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2020 , 19:56   Re: [Help] Drop weapon if user is under level 10
Reply With Quote #9

I don't see why not.
__________________
Bugsy 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 00:56.


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