SA-MP Forums Archive
a weird problem.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: a weird problem.. (/showthread.php?tid=642293)



a weird problem.. - Puff - 27.09.2017

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}}; 
The problem is that.. when creating illegal biz.. it creates a biz and then saves it MYSQL aswell.. but when I press the Enter key to enter the businesss it doesn't set my pos to the interior... it just doesn't work and shows that (( /buy to buy things )) only.. but it doesn't set my position to that interior..?


Re: a weird problem.. - Misiur - 27.09.2017

Show loading code. Use prints to get current state of data.