1, 2, 4, 8, 16... system
Hello guys,
I'm creating a Knife Skins Shop for my server, and I want to save in only one variable which knifes a user have, and im trying to use the system 1, 2, 4, 8, 16 (if the user buys the first skin and the third, is value will be 5, because 1+4) but im having serious problems, because I think its hardcode to check like this: PHP Code:
|
Re: 1, 2, 4, 8, 16... system
PHP Code:
|
Re: 1, 2, 4, 8, 16... system
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: 1, 2, 4, 8, 16... system
it's not correct.
You shall use & symbol, like: if(szKnife[id] & 1 || szKnife[id] & 2 || szKnife[id] & 3) But explain what are you trying to do... |
Re: 1, 2, 4, 8, 16... system
Quote:
Quote:
|
Re: 1, 2, 4, 8, 16... system
Quote:
|
Re: 1, 2, 4, 8, 16... system
Quote:
|
Re: 1, 2, 4, 8, 16... system
Sorry man, you're right!
I solved that error, but now i have another one: PHP Code:
|
Re: 1, 2, 4, 8, 16... system
PHP Code:
|
Re: 1, 2, 4, 8, 16... system
Mabe sure result is integer (*int) and not boolean, float or other type of data.
p.s. You can check its type when you create the SQL table. And if it has wrong data type then you shall delete the table and let plugin create new one. |
| All times are GMT -4. The time now is 18:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.