AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   enum question (https://forums.alliedmods.net/showthread.php?t=283218)

SKAtZ. 05-28-2016 00:59

enum question
 
Im trying to make a loop to create a menu list of my Items Shop, the code below is a example how I made it, and Im trying to make an option if the user already have that item doesn't show the price, but if they didnt have that item the price appears, but I don't know the correct way to do it.

If someone could help me that would be great!

Spoiler

Black Rose 05-28-2016 14:04

Re: enum question
 
I think what you want to do is change this:
Code:
new I: iItemsUser[MAX_PLAYERS+1][ITEM];
to this:
Code:
new I: g_ItemsUser[MAX_PLAYERS+1];
and use
Code:
if ( g_ItemsUser[id] & I:(1<<i) )

SKAtZ. 05-31-2016 23:29

Re: enum question
 
Quote:

Originally Posted by Black Rose (Post 2422780)
I think what you want to do is change this:
Code:
new I: iItemsUser[MAX_PLAYERS+1][ITEM];
to this:
Code:
new I: g_ItemsUser[MAX_PLAYERS+1];
and use
Code:
if ( g_ItemsUser[id] & I:(1<<i) )

Yeah, it makes sense! Thank you :)


All times are GMT -4. The time now is 18:37.

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