Simple Help
#1

I want ask about this command
PHP код:
CMD:bizlock(playeridparams[])
{
    new 
string[128], lockdone;
    if(
PlayerInfo[playerid][pBusiness] != INVALID_BIZ_ID)
    {
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[PlayerInfo[playerid][pBusiness]][bX], BizInfo[PlayerInfo[playerid][pBusiness]][bY], BizInfo[PlayerInfo[playerid][pBusiness]][bZ]))
        {
            if(!
BizInfo[PlayerInfo[playerid][pBusiness]][bStatus])
            {
                
BizInfo[PlayerInfo[playerid][pBusiness]][bStatus] = 1;
                
format(stringsizeof(string), "{FFFFFF}%s\nStatus: %s\n{00AAFF}%s\nEntrance Fee: $%d\nOwner: %s\nBusiness ID: %d",BizInfo[PlayerInfo[playerid][pBusiness]][bDescription],RBS(PlayerInfo[playerid][pBusiness]),RBT(PlayerInfo[playerid][pBusiness]),BizInfo[PlayerInfo[playerid][pBusiness]][bBizFee],BizInfo[PlayerInfo[playerid][pBusiness]][bOwner], PlayerInfo[playerid][pBusiness]);
                
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBusiness]][bText], 0x00AAFFFFstring);
                
format(stringsizeof(string), "* %s takes out their business keys and unlocks it."GetPlayerNameEx(playerid));
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
GameTextForPlayer(playerid"~g~Business Unlocked"35003);
            }
            else if(
BizInfo[PlayerInfo[playerid][pBusiness]][bStatus])
            {
                
BizInfo[PlayerInfo[playerid][pBusiness]][bStatus] = 0;
                
format(stringsizeof(string), "{FFFFFF}%s\nStatus: %s\n{00AAFF}%s\nEntrance Fee: $%d\nOwner: %s\nBusiness ID: %d",BizInfo[PlayerInfo[playerid][pBusiness]][bDescription],RBS(PlayerInfo[playerid][pBusiness]),RBT(PlayerInfo[playerid][pBusiness]),BizInfo[PlayerInfo[playerid][pBusiness]][bBizFee],BizInfo[PlayerInfo[playerid][pBusiness]][bOwner], PlayerInfo[playerid][pBusiness]);
                
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBusiness]][bText], 0x00AAFFFFstring);
                
format(stringsizeof(string), "* %s takes out their business keys and locks it."GetPlayerNameEx(playerid));
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
GameTextForPlayer(playerid"~r~Business Locked"35003);
            }
            
lockdone 1;
        }
         if(!
lockdone)
        {
            
SendClientMessage(playeridCOLOR_GREY"You are not near at your business");
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GRAD2"You either don't own a business");
        return 
1;
    }
    return 
1;

When i lock biz and enter still not locked mean any one can enter i dont know what is worng on it?

is ther eany rep here?

, k guys
Reply
#2

what about /enter cmd? Did you place that no one can enter if business is locked ?
Reply
#3

This is the enter cmd
PHP код:
    for(new i=1i<MAX_BUSINESSi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[i][bX], BizInfo[i][bY], BizInfo[i][bZ]))
        {
            if(
PlayerInfo[playerid][pBusiness] == || BizInfo[i][bStatus] == 1)
            {
                if(
GetPlayerCash(playerid) >= BizInfo[i][bBizFee])
                {
                    
GivePlayerCash(playerid, - BizInfo[i][bBizFee]);
                    
BizInfo[i][bMoney] += BizInfo[i][bBizFee];
                    if(
PlayerInfo[playerid][pBusiness] == i)
                    {
                        if(
PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered the business."); }
                        else { 
format(stringsizeof(string), "* %s has entered their business."GetPlayerNameEx(playerid)); }
                        
ProxDetector(25.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                    else
                    {
                        if(
PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered %s's business."BizInfo[i][bOwner]); }
                        else { 
format(stringsizeof(string), "* %s has entered %s."GetPlayerNameEx(playerid), BizInfo[i][bDescription]); }
                        
ProxDetector(25.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                    
SetPlayerInterior(playerid,BizInfo[i][bBInteriorWorld]);
                    
PlayerInfo[playerid][pInt] = BizInfo[i][bBInteriorWorld];
                    
PlayerInfo[playerid][pVW] = i+100;
                    
SetPlayerVirtualWorld(playeridi+100);
                    
PlayerInfo[playerid][InBusiness] = i;
                     if(
BizInfo[i][bCustomInterior] == 1)
                    {
                        
LoadObjectsForPlayer(playerid);
                    }
                    
SetPlayerPos(playerid,BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
                    
SetPlayerFacingAngle(playerid,BizInfo[i][bInteriorA]);
                    
SetCameraBehindPlayer(playerid);
                    if(
PlayerInfo[playerid][pBusiness] == i)
                    {
                        
GameTextForPlayer(playerid"~w~Welcome Home"50001);
                     }
                     if(
BizInfo[i][bType] > && BizInfo[i][bType] != 5)
                    {
                           
SendClientMessage(playerid,COLOR_WHITE,"   Use /buy to purchase something from this business !");
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD1" You don't have cash for that Business Entrance Fee");
                }
                
Streamer_UpdateEx(playeridBizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
            }
            return 
1;
        }
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)