Printing out something from an enum
#3

Quote:
Originally Posted by Amit1998
Посмотреть сообщение
Hey guys, been trying to use enums for database storing purposes, anywho here's the enum(some of it):

PHP код:
enum biz_Lists
{
    
biz_T,
    
biz_N[50],
}
new 
BizTypeList[][biz_Lists] = {
    {
BUSINESS_TYPE_BANK"Bank"},
    {
BUSINESS_TYPE_247"Grocery Store"}, 
and here are the code lines for the formatting a string to the variable:
PHP код:
    BizTypeList[biz_T] = bizType;
    
format(iStrsizeof(iStr), "%s"BizTypeList[biz_T][biz_N]); 
tho it doesn't really work. Been trying to shift things around and got shitloads of errors.
would love for some help! Thanks :>
This a wrong way to use list. I don't know how to do what you want. I understand but I don't know. Maybe someone can give the solution.. :/

PHP код:
#include <a_samp>
/*enum biz_Lists
{
    biz_T,
    biz_N[50],
}*/
enum bizType
{
    
BUSINESS_TYPE_BANK,
    
BUSINESS_TYPE_247
}
new 
BizTypeList[2][] =
{
    
"Bank",
    
"Grocery Store"
};
new 
biz[bizType];
main()
{
    
printf("%s %s"BizTypeList[0][0], BizTypeList[1][0]);

Reply


Messages In This Thread
Printing out something from an enum - by Amit1998 - 30.05.2016, 21:13
Re: Printing out something from an enum - by Amit1998 - 31.05.2016, 15:09
Re: Printing out something from an enum - by Dayrion - 31.05.2016, 15:57
Re: Printing out something from an enum - by Kaliber - 31.05.2016, 15:58
Re: Printing out something from an enum - by Amit1998 - 31.05.2016, 17:07
Re: Printing out something from an enum - by Kaliber - 31.05.2016, 17:14
Re: Printing out something from an enum - by Amit1998 - 31.05.2016, 17:41
Re: Printing out something from an enum - by Konstantinos - 31.05.2016, 18:28
Re: Printing out something from an enum - by Amit1998 - 31.05.2016, 18:57
Re: Printing out something from an enum - by Konstantinos - 31.05.2016, 19:15

Forum Jump:


Users browsing this thread: 1 Guest(s)