27.09.2017, 14:55
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(playerid, COLOR_LIGHTGREEN, "(( Do /buy to buy things ))");
SetPlayerPos(playerid, IBInteriors[interior][EIBX],IBInteriors[interior][EIBY],IBInteriors[interior][EIBZ]);
SetPlayerInterior(playerid, IBInteriors[interior][EIBInterior]);
SetPlayerVirtualWorld(playerid, IllegalBusinesses[i][EIllegalBiz_SQLID]+25000);
SetPlayerFacingAngle(playerid, IBInteriors[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(playerid, IllegalBusinesses[i][EIllegalBiz_X], IllegalBusinesses[i][EIllegalBiz_Y], IllegalBusinesses[i][EIllegalBiz_Z]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
}
}
}
}
PHP код:
getIBizInside(playerid, Float:range = 150.0) {
for(new i=0;i<MAX_ILLEGAL_BIZ;i++) {
if(IllegalBusinesses[i][EIllegalBiz_SQLID] != 0) {
new interior = IllegalBusinesses[i][EIllegalBiz_Interior];
if(IsPlayerInRangeOfPoint(playerid,range,IBInteriors[interior][EIBX],IBInteriors[interior][EIBY],IBInteriors[interior][EIBZ])) {
if(GetPlayerVirtualWorld(playerid) == IllegalBusinesses[i][EIllegalBiz_SQLID]+25000) {
return i;
}
}
}
}
return -1;
}
PHP код:
enum EIllegalBizInteriors {
Float:EIBX,
Float:EIBY,
Float:EIBZ,
Float:EIBAngle,
EIBInterior,
EIBName[32],
EIBPrice,
};
new IBInteriors[][EIllegalBizInteriors] = {{422.571838, 2536.541503, 10.000000, 86.274101, 10, "Small House", 500000}};