format(query, sizeof(query), "SELECT * FROM business");
mysql_function_query(dbhandle, query, true, "OnBizLoad", "");
public OnBizLoad()
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=GetFreeBizID();
bInfo[id][b_x]=cache_get_field_content_float(i, "b_x",dbhandle);
bInfo[id][b_y]=cache_get_field_content_float(i, "b_y",dbhandle);
bInfo[id][b_z]=cache_get_field_content_float(i, "b_z",dbhandle);
bInfo[id][b_intx]=cache_get_field_content_float(i, "b_intx",dbhandle);
bInfo[id][b_inty]=cache_get_field_content_float(i, "b_inty",dbhandle);
bInfo[id][b_intz]=cache_get_field_content_float(i, "b_intz",dbhandle);
bInfo[id][b_int]=cache_get_field_content_int(i, "b_int", dbhandle);
bInfo[id][b_entry]=cache_get_field_content_int(i, "b_entry", dbhandle);
bInfo[id][b_price]=cache_get_field_content_int(i, "b_price", dbhandle);
bInfo[id][b_selling]=cache_get_field_content_int(i, "b_selling", dbhandle);
new tmp_bname[128],tmp_type[20];
cache_get_field_content(i, "b_name", tmp_bname);
strmid(bInfo[id][b_name], tmp_bname, 0, sizeof(tmp_bname), sizeof(tmp_bname));
cache_get_field_content(i, "b_type", tmp_type);
strmid(bInfo[id][b_type], tmp_type, 0, sizeof(tmp_type), sizeof(tmp_type));
new tmp_name[MAX_PLAYER_NAME];
cache_get_field_content(i, "b_owner", tmp_name);
strmid(bInfo[id][b_owner], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
bInfo[id][b_id]=cache_get_field_content_int(i, "id", dbhandle);
bInfo[id][b_price]=cache_get_field_content_int(i, "b_price", dbhandle);
new m[126];
format(m, sizeof(m), "ICON POST : %f,%f,%f | Interiror : %f,%f,%f", bInfo[id][b_x],bInfo[id][b_y],bInfo[id][b_z],bInfo[id][b_intx],bInfo[id][b_inty],bInfo[id][b_intz]);
SendClientMessageToAll(-1, m);
UpdateBiz(id);
}
return 1;
}
If the problem is in your enum?
Do you get any error or anything? If your exterior works, then why interior not? |
YCMD:biz(playerid, params[], help)
{
new biz;
if(sscanf(params, "i", biz)) return SendUsage(playerid,"/biz <number>");
SetPlayerInterior(playerid,bInfo[biz][b_int]);
SetPlayerPos(playerid,bInfo[biz][b_intx],bInfo[biz][b_inty],bInfo[biz][b_intz]);
return 1;
}
try this cmd
PHP код:
|
enum BizInfo{
b_id,
b_name[156],
b_owner[MAX_PLAYER_NAME],
b_type,
b_int,
Float:b_ix,
Float:b_iy,
Float:b_iz,
b_selling,
b_price,
b_entry,
Float:b_x,
Float:b_y,
Float:b_z,
Text3D:b_label,
b_pickup
};
bInfo[id][b_intx]=cache_get_field_content_float(i, "b_intx",dbhandle);
bInfo[id][b_inty]=cache_get_field_content_float(i, "b_inty",dbhandle);
bInfo[id][b_intz]=cache_get_field_content_float(i, "b_intz",dbhandle);
Float:b_ix,
Float:b_iy,
Float:b_iz,
PHP код:
PHP код:
|
enum BizInfo{
b_id,
b_name[156],
b_owner[MAX_PLAYER_NAME],
b_type,
b_int,
Float:b_ix,
Float:b_iy,
Float:b_iz,
b_selling,
b_price,
b_entry,
Float:b_x,
Float:b_y,
Float:b_z,
Text3D:b_label,
b_pickup
};
new bInfo[MAX_BIZ][BizInfo];
forward OnBizLoad();
public OnGameModeInit()
{
DisableInteriorEnterExits();
//mysql
dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
//Load Biz
format(query, sizeof(query), "SELECT * FROM business");
mysql_function_query(dbhandle, query, true, "OnBizLoad", "");
return 1;
}
public OnBizLoad()
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=GetFreeBizID();
bInfo[id][b_x]=cache_get_field_content_float(i, "b_x",dbhandle);
bInfo[id][b_y]=cache_get_field_content_float(i, "b_y",dbhandle);
bInfo[id][b_z]=cache_get_field_content_float(i, "b_z",dbhandle);
bInfo[id][b_ix]=cache_get_field_content_float(i, "b_x",dbhandle);
bInfo[id][b_iy]=cache_get_field_content_float(i, "b_y",dbhandle);
bInfo[id][b_iz]=cache_get_field_content_float(i, "b_z",dbhandle);
bInfo[id][b_int]=cache_get_field_content_int(i, "b_int", dbhandle);
bInfo[id][b_entry]=cache_get_field_content_int(i, "b_entry", dbhandle);
bInfo[id][b_price]=cache_get_field_content_int(i, "b_price", dbhandle);
bInfo[id][b_selling]=cache_get_field_content_int(i, "b_selling", dbhandle);
new tmp_bname[128],tmp_type[20];
cache_get_field_content(i, "b_name", tmp_bname);
strmid(bInfo[id][b_name], tmp_bname, 0, sizeof(tmp_bname), sizeof(tmp_bname));
cache_get_field_content(i, "b_type", tmp_type);
strmid(bInfo[id][b_type], tmp_type, 0, sizeof(tmp_type), sizeof(tmp_type));
new tmp_name[MAX_PLAYER_NAME];
cache_get_field_content(i, "b_owner", tmp_name);
strmid(bInfo[id][b_owner], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
bInfo[id][b_id]=cache_get_field_content_int(i, "id", dbhandle);
bInfo[id][b_price]=cache_get_field_content_int(i, "b_price", dbhandle);
new m[126];
format(m, sizeof(m), "ICON POST : %f,%f,%f | Interiror : %f,%f,%f", bInfo[id][b_x],bInfo[id][b_y],bInfo[id][b_z],bInfo[id][b_ix],bInfo[id][b_iy],bInfo[id][b_iz]);
SendClientMessageToAll(-1, m);
UpdateBiz(id);
}
return 1;
}
UpdateBiz(id)
{
new string[126];
if(bInfo[id][b_pickup])
{
DestroyPickup(bInfo[id][b_pickup]);
}
if(bInfo[id][b_label])
{
Delete3DTextLabel(bInfo[id][b_label]);
}
if(!strlen(bInfo[id][b_owner]))
{
bInfo[id][b_pickup]=CreatePickup(1273, 1, bInfo[id][b_x], bInfo[id][b_y], bInfo[id][b_z], -1);
format(string,sizeof(string),"Business for sell!\nID : %i\nPrice : $%i",bInfo[id][b_id],bInfo[id][b_price]);
bInfo[id][b_label] = Create3DTextLabel(string, 0x008080FF, bInfo[id][b_x], bInfo[id][b_y], bInfo[id][b_z] , 10, 0, 1);
new query[128];
format(query, sizeof(query), "UPDATE business SET b_owner='%s', b_price='%i', b_selling='%i', b_name='%s', b_entry='%i' WHERE id='%i'", bInfo[id][b_owner],bInfo[id][b_price],bInfo[id][b_selling],bInfo[id][b_name],bInfo[id][b_entry],bInfo[id][b_id]);
mysql_function_query(dbhandle, query, false, "", "");
}
else
{
bInfo[id][b_pickup]=CreatePickup(1272, 1, bInfo[id][b_x], bInfo[id][b_y], bInfo[id][b_z], -1);
format(string,sizeof(string),"%s\nBuisness Name:%s\nBusiness owner:{f70404}%s\nEntry Fee:$%i",bInfo[id][b_type],bInfo[id][b_name],bInfo[id][b_owner],bInfo[id][b_entry]);
bInfo[id][b_label] = Create3DTextLabel(string, 0xFFFF00AA, bInfo[id][b_x], bInfo[id][b_y], bInfo[id][b_z] , 10, 0, 1);
new query[128];
format(query, sizeof(query), "UPDATE business SET b_owner='%s', b_price='%i', b_selling='%i', b_name='%s', b_entry='%i' WHERE id='%i'", bInfo[id][b_owner],bInfo[id][b_price],bInfo[id][b_selling],bInfo[id][b_name],bInfo[id][b_entry],bInfo[id][b_id]);
mysql_function_query(dbhandle, query, false, "", "");
}
if(bInfo[id][b_int] == 0)
{
if(bInfo[id][b_label])
{
Delete3DTextLabel(bInfo[id][b_label]);
}
}
return 1;
}