Printing out something from an enum
#7

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
//Edit:
Oh god...now i see what you wanna do...
Just make it like this:

PHP код:
COMMAND:checkbiztype(playeridparams[]) 
{
    new 
index,string[128]; //Use this..you should avoid global strings...
    
if( sscanf params"d"index)) return SCP(playerid"[BizID]"); 
    if(
index || index >= sizeof(BusinessInfo)) return SCP(playerid,"Index out of Bounds!"); 
    
format(stringsizeof(string), "String: %s || Int: %d"getBizName(BusinessInfo[index][bType]),  BusinessInfo[index][bType]); 
    
SendClientMessage(playeridCOLOR_WHITEstring); 
    return 
1
}
stock getBizName(index)
{
    new 
name[50];
    switch(
index)
    {
        case 
BUSINESS_TYPE_BANKname="Bank";
        case 
BUSINESS_TYPE_247name="Grocery Store";
    }
    return 
name;

Hum, why isn't this working then?

PHP код:
stock CreateBusiness(bizOwner[], bizTypeFloat:bizXFloat:bizYFloat:bizZInteriorVirtualWorld)
{
// Missing codelines ---> bizType is an int which refers to the ID of a biz type, which is used to create business from the BizTypeList..
    
new iTypeName BizTypeList[bizType][biz_N];
    
mysql_format(MySQLPipelineiQuerysizeof(iQuery), "INSERT INTO `businessinfo` (`ID`, `Owner`, `Type`, `TypeName`, `X`, `Y`, `Z`, `CompsFlag`, `Interior`, `VirtualWorld`, `Street`) VALUES (%d, '%e', %d, '%e', %f, %f, %f, %d, %d, %d, '%e')"businessidbizOwnerbizTypeiTypeNamebizXbizYbizZcompsFInteriorVirtualWorldzone);
    
mysql_tquery(MySQLPipelineiQuery); 
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)