Business Entrance&Exit
#1

Interior of the biz:
PHP код:
enum EIllegalBizInteriors {
    
Float:EIBX,
    
Float:EIBY,
    
Float:EIBZ,
    
Float:EIBAngle,
    
EIBInterior,
    
EIBName[32],
    
EIBPrice,
};
new 
IBInteriors[][EIllegalBizInteriors] = {{422.5718382536.54150310.00000086.27410110"Small House"500000}};
illegalBizOnGameModeInit() {
    
query[0] = 0;
    
format(querysizeof(query), "SELECT `ibiz`.`id`,`ibiz`.`name`,`ibiz`.`ownertype`,`ibiz`.`owner`,`c`.`username`,`ibiz`.`x`,`ibiz`.`y`,`ibiz`.`z`,`ibiz`.`interiortype`,`ibiz`.`closed`,`ibiz`.`till`,`ibiz`.`matsa`,`ibiz`.`matsb`,`ibiz`.`matsc`,`ibiz`.`pot`,`ibiz`.`coke`,`ibiz`.`meth`,`ibiz`.`gunprofit`,`ibiz`.`drugprofit` FROM `illegalbiz` AS `ibiz` LEFT JOIN `characters` AS `c` ON `owner` = `c`.`id`");
    
mysql_function_query(g_mysql_handlequerytrue"OnLoadIllegalBiz""");


when trying to enter biz..

PHP код:
iBizTryEnter(playerid) {
    for(new 
i=0;i<MAX_ILLEGAL_BIZ;i++) {
        if(
IllegalBusinesses[i][EIllegalBiz_SQLID] != 0) {
            new 
interior IllegalBusinesses[i][EIllegalBiz_Interior];
            if(
IsPlayerInRangeOfPoint(playerid,1.5,IllegalBusinesses[i][EIllegalBiz_X], IllegalBusinesses[i][EIllegalBiz_Y], IllegalBusinesses[i][EIllegalBiz_Z])) {
                if(
IllegalBusinesses[i][EIllegalBiz_Closed] == 0) {
                    
HintMessage(playeridCOLOR_LIGHTGREEN"(( Do /buy to buy things ))");
                    
SetPlayerPos(playeridIBInteriors[interior][EIBX],IBInteriors[interior][EIBY],IBInteriors[interior][EIBZ]);
                    
SetPlayerInterior(playeridIBInteriors[interior][EIBInterior]);
                    
SetPlayerVirtualWorld(playeridIllegalBusinesses[i][EIllegalBiz_SQLID]+25000);
                    
SetPlayerFacingAngle(playeridIBInteriors[interior][EIBAngle]);
                }
            } else if(
IsPlayerInRangeOfPoint(playerid,1.5,IBInteriors[interior][EIBX],IBInteriors[interior][EIBY],IBInteriors[interior][EIBZ])) {
                if(
GetPlayerVirtualWorld(playerid) == IllegalBusinesses[i][EIllegalBiz_SQLID]+25000) {
                    
SetPlayerPos(playeridIllegalBusinesses[i][EIllegalBiz_X], IllegalBusinesses[i][EIllegalBiz_Y], IllegalBusinesses[i][EIllegalBiz_Z]);
                    
SetPlayerInterior(playerid0);
                    
SetPlayerVirtualWorld(playerid0);
                }
            }
        }
    }

the problem is.. when you makebiz and try to enter.. it doesnt teleport you to the interior..


makebiz CMD: incase
PHP код:
YCMD:makeibiz(playeridparams[], help) {
    if(
help) {
        
SendClientMessage(playeridX11_WHITE"Creates an illegal business");
        return 
1;
    }
    new 
name[32];
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(!
sscanf(params,"s[32]"name)) {
        
createIllegalBusiness(X,Y,Z,10,name);
    } else {
        
SendClientMessage(playeridX11_WHITE"USAGE: /makeibiz [name]");
    }
    return 
1;

Reply
#2

Show us your createIllegalBusiness stock please
Reply
#3

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Show us your createIllegalBusiness stock please
PHP код:
forward OnCreateIllegalBiz();
public 
OnCreateIllegalBiz() {
    new 
id mysql_insert_id();
    
format(querysizeof(query), "SELECT `ibiz`.`id`,`ibiz`.`name`,`ibiz`.`ownertype`,`ibiz`.`owner`,`c`.`username`,`ibiz`.`x`,`ibiz`.`y`,`ibiz`.`z`,`ibiz`.`interiortype`,`ibiz`.`closed`,`ibiz`.`till`,`ibiz`.`matsa`,`ibiz`.`matsb`,`ibiz`.`matsc`,`ibiz`.`pot`,`ibiz`.`coke`,`ibiz`.`meth`,`ibiz`.`gunprofit`,`ibiz`.`drugprofit`  FROM `illegalbiz` AS `ibiz` LEFT JOIN `characters` AS `c` ON `owner` = `c`.`id` WHERE `ibiz`.`id` = %d",id);
    
mysql_function_query(g_mysql_handlequerytrue"OnLoadIllegalBiz""");
    
format(querysizeof(query), "[AdmNotice]: Illegal Business ID: %d",id);
    
ABroadcast(X11_RED,query,EAdminFlags_BusinessAdmin);
}
createIllegalBusiness(Float:X,Float:Y,Float:Z,interior,name[]) {
    new 
name_esc[(32*2)+1];
    
mysql_real_escape_string(namename_esc);
    
format(querysizeof(query), "INSERT INTO `illegalbiz` SET `name` = \"%s\", `x` = %f, `y` = %f, `z` = %f,`interiortype` = %d",name_esc,X,Y,Z,interior);
    
mysql_function_query(g_mysql_handlequerytrue"OnCreateIllegalBiz""");
}
setIBizName(sbizname[]) {
    new 
name_esc[(32*2)+1];
    
mysql_real_escape_string(namename_esc);
    
format(IllegalBusinesses[sbiz][EIllegalBiz_Name], 32"%s"name);
    
format(querysizeof(query), "UPDATE `illegalbiz` SET `name` = \"%s\" WHERE `id` = %d",name_esc,IllegalBusinesses[sbiz][EIllegalBiz_SQLID]);
    
mysql_function_query(g_mysql_handlequerytrue"EmptyCallback""");    
    new 
biztext[128];
    
format(biztextsizeof(biztext), "{FF0000}%s",IllegalBusinesses[sbiz][EIllegalBiz_Name]);
    
UpdateDynamic3DTextLabelText(IllegalBusinesses[sbiz][EIllegalBiz_3DText], COLOR_LIGHTGREENbiztext);
    

Reply
#4

Does it even creates for you the pickup icon and the text of the business? and does the business table appears in your database?

EDIT: I also guess that this line is fucked up

PHP код:
format(querysizeof(query), "SELECT `ibiz`.`id`,`ibiz`.`name`,`ibiz`.`ownertype`,`ibiz`.`owner`,`c`.`username`,`ibiz`.`x`,`ibiz`.`y`,`ibiz`.`z`,`ibiz`.`interiortype`,`ibiz`.`closed`,`ibiz`.`till`,`ibiz`.`matsa`,`ibiz`.`matsb`,`ibiz`.`matsc`,`ibiz`.`pot`,`ibiz`.`coke`,`ibiz`.`meth`,`ibiz`.`gunprofit`,`ibiz`.`drugprofit`  FROM `illegalbiz` AS `ibiz` LEFT JOIN `characters` AS `c` ON `owner` = `c`.`id` WHERE `ibiz`.`id` = %d",id
Reply
#5

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Does it even creates for you the pickup icon and the text of the business? and does the business table appears in your database?

EDIT: I also guess that this line is fucked up

PHP код:
format(querysizeof(query), "SELECT `ibiz`.`id`,`ibiz`.`name`,`ibiz`.`ownertype`,`ibiz`.`owner`,`c`.`username`,`ibiz`.`x`,`ibiz`.`y`,`ibiz`.`z`,`ibiz`.`interiortype`,`ibiz`.`closed`,`ibiz`.`till`,`ibiz`.`matsa`,`ibiz`.`matsb`,`ibiz`.`matsc`,`ibiz`.`pot`,`ibiz`.`coke`,`ibiz`.`meth`,`ibiz`.`gunprofit`,`ibiz`.`drugprofit`  FROM `illegalbiz` AS `ibiz` LEFT JOIN `characters` AS `c` ON `owner` = `c`.`id` WHERE `ibiz`.`id` = %d",id
It does create a pickup, it does show text, it does show info aswell, it does save in SQL and create a table aswell... with the right axis.. just can't go inside.. when I press enter key or /enter it just spawn me at the same place..
Reply
#6

Okay it is either in creation, or either in the /enter cmd itself, Show me the /enter command (part of businesses) and show me how do you set an interior for the biz.
Reply
#7

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Okay it is either in creation, or either in the /enter cmd itself, Show me the /enter command (part of businesses) and show me how do you set an interior for the biz.
PHP код:
iBizTryEnter(playerid) { 
    for(new 
i=0;i<MAX_ILLEGAL_BIZ;i++) { 
        if(
IllegalBusinesses[i][EIllegalBiz_SQLID] != 0) { 
            new 
interior IllegalBusinesses[i][EIllegalBiz_Interior]; 
            if(
IsPlayerInRangeOfPoint(playerid,1.5,IllegalBusinesses[i][EIllegalBiz_X], IllegalBusinesses[i][EIllegalBiz_Y], IllegalBusinesses[i][EIllegalBiz_Z])) { 
                if(
IllegalBusinesses[i][EIllegalBiz_Closed] == 0) { 
                    
HintMessage(playeridCOLOR_LIGHTGREEN"(( Do /buy to buy things ))"); 
                    
SetPlayerPos(playeridIBInteriors[interior][EIBX],IBInteriors[interior][EIBY],IBInteriors[interior][EIBZ]); 
                    
SetPlayerInterior(playeridIBInteriors[interior][EIBInterior]); 
                    
SetPlayerVirtualWorld(playeridIllegalBusinesses[i][EIllegalBiz_SQLID]+25000); 
                    
SetPlayerFacingAngle(playeridIBInteriors[interior][EIBAngle]); 
                } 
Reply
#8

Show me "OnLoadIllegalBiz" please
Reply
#9

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Show me "OnLoadIllegalBiz" please
PHP код:
forward OnLoadIllegalBiz();
public 
OnLoadIllegalBiz() {
    new 
rowsfields;
    new 
id_string[32];
    
cache_get_data(rowsfields);
    if(
rows MAX_ILLEGAL_BIZ) {
        
printf("Warning: Increase MAX_ILLEGAL_BIZ to %d\n",rows);
    }
    for(new 
i=0;i<rows;i++) {
        new 
slot findFreeIllegalBiz();
        if(
slot == -1) {
            
printf("IllegalBusinesses IS FULL!\n");
            continue;
        }
        
cache_get_row(i0id_string);
        
IllegalBusinesses[slot][EIllegalBiz_SQLID] = strval(id_string);
        
        
cache_get_row(i1IllegalBusinesses[slot][EIllegalBiz_Name]);
        
        
cache_get_row(i2id_string);
        
IllegalBusinesses[slot][EIllegalBiz_OwnerType] = strval(id_string);
        
        
cache_get_row(i3id_string);
        
IllegalBusinesses[slot][EIllegalBiz_OwnerSQLID] = strval(id_string);
        
        
        if(
IllegalBusinesses[slot][EIllegalBiz_OwnerType] == 1) {
            
cache_get_row(i4IllegalBusinesses[slot][EIllegalBiz_Ownername]);
        }
        
        new 
Float:XFloat:YFloat:Z,intid;
        
        
        
cache_get_row(i5id_string);
        
floatstr(id_string);
        
cache_get_row(i6id_string);
        
floatstr(id_string);
        
cache_get_row(i7id_string);
        
floatstr(id_string);
        
cache_get_row(i8id_string);
        
intid strval(id_string);
        
        
cache_get_row(i9id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Closed] = strval(id_string);
        
        
cache_get_row(i10id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Till] = strval(id_string);
        
        
        
cache_get_row(i11id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Mats][0] = strval(id_string);
        
        
cache_get_row(i12id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Mats][1] = strval(id_string);
        
        
cache_get_row(i13id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Mats][2] = strval(id_string);
        
        
cache_get_row(i14id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Drugs][0] = strval(id_string);        
        
        
cache_get_row(i15id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Drugs][1] = strval(id_string);        
        
        
cache_get_row(i16id_string);
        
IllegalBusinesses[slot][EIllegalBiz_Drugs][2] = strval(id_string);        
        
        
cache_get_row(i17id_string);
        
IllegalBusinesses[slot][EIllegalBiz_GunProfit] = strval(id_string);        
        
        
cache_get_row(i18id_string);
        
IllegalBusinesses[slot][EIllegalBiz_DrugProfit] = strval(id_string);        
        
        
IllegalBusinesses[slot][EIllegalBiz_X] = X;
        
IllegalBusinesses[slot][EIllegalBiz_Y] = Y;
        
IllegalBusinesses[slot][EIllegalBiz_Z] = Z;
        
IllegalBusinesses[slot][EIllegalBiz_Interior] = intid;
        new 
biztext[128];
        
format(biztextsizeof(biztext), "{FF0000}%s",IllegalBusinesses[slot][EIllegalBiz_Name]);
        
IllegalBusinesses[slot][EIllegalBiz_PickupID] = CreateDynamicPickup(125416XYZ);
        
IllegalBusinesses[slot][EIllegalBiz_3DText] = CreateDynamic3DTextLabel(biztextgetPointColour(i), XYZ+1.010.0);                        
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)