How to make this work both ways
#1

ok i have this cmd

pawn Код:
CMD:buy(playerid, params[])
{
    new idx = GetPlayerVirtualWorld(playerid)-100;
    if(idx > 0 && idx < MAX_BIZ && BizInfo[idx][bType] != 1 && BizInfo[idx][bType] != 2 && BizInfo[idx][bType] != 3 && BizInfo[idx][bType] != 4 && BizInfo[idx][bType] != 6 || idx < 1 || idx > MAX_BIZ) return SendClientMessage(playerid, COLOR_LIME, "You are not inside a business.");
    if(BizInfo[idx][bType] == 1)
    {
        ShowPlayerDialog(playerid, STOREMENU, DIALOG_STYLE_LIST, "24/7", "Cell Phone        $400\nPhone Book        $4000\nDice         $400\nCondom        $40\nCD Player      $40\nSpraycan       $160\nRope          $800\nCigar         $40\nSprunk         $8\nVehicle Lock        $4000\nPortable Radio       $40000\nCamera          $160\nLottery Ticket        $800\nCheckbook     $400\nMask          $5000\nBoombox      $50000\nSuitCase        $10000", "Buy", "Cancel");
    }
    else if(BizInfo[idx][bType] == 3)
    {
        ShowPlayerDialog(playerid, AMMUMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Shotgun (5000)\nMp5 (20000)\nDeagle (35000)\nM4 (75000)\nFullVest (3000)", "Buy", "Cancel");
    }
    return 1;
}
but i want it to be able to be used if im in the co ordinates of any 24/7 interior no matter if its linked to a business

i also have this

pawn Код:
stock IsAt247(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid, 100.0, -30.875, -88.9609, 1004.53))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 10.0, -2654.2300,1526.3693,907.1797))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, 890.66, 1429.08, -82.34))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, -29.2035, -185.1285, 1003.5469))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, 2.0450,-29.0116,1003.5494))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, -28.1463,-89.9533,1003.5469))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, -22.0699,-138.6297,1003.5469))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, -22.0699,-138.6297,1003.5469))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, -30.9772,-29.0228,1003.5573))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 50.0, -23.4488,-55.6319,1003.5469))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 500, 2554.471435, 1417.497802, 7700.006347)) // VIP Lounge
        {
            return 1;
        }
    }
    return 0;
}
please help me
Reply
#2

pawn Код:
CMD:buy(playerid, params[])
{
    new idx = GetPlayerVirtualWorld(playerid)-100;
    if(idx > 0 && idx < MAX_BIZ && BizInfo[idx][bType] != 1 && BizInfo[idx][bType] != 2 && BizInfo[idx][bType] != 3 && BizInfo[idx][bType] != 4 && BizInfo[idx][bType] != 6 || idx < 1 || idx > MAX_BIZ) return SendClientMessage(playerid, COLOR_LIME, "You are not inside a business.");
    if(IsAt247(playerid))
    {
        ShowPlayerDialog(playerid, STOREMENU, DIALOG_STYLE_LIST, "24/7", "Cell Phone        $400\nPhone Book        $4000\nDice         $400\nCondom        $40\nCD Player      $40\nSpraycan       $160\nRope          $800\nCigar         $40\nSprunk         $8\nVehicle Lock        $4000\nPortable Radio       $40000\nCamera          $160\nLottery Ticket        $800\nCheckbook     $400\nMask          $5000\nBoombox      $50000\nSuitCase        $10000", "Buy", "Cancel");
    }
    else if(BizInfo[idx][bType] == 3)
    {
        ShowPlayerDialog(playerid, AMMUMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Shotgun (5000)\nMp5 (20000)\nDeagle (35000)\nM4 (75000)\nFullVest (3000)", "Buy", "Cancel");
    }
    return 1;
}
Reply
#3

nope doesnt work :/
Reply
#4

pawn Код:
CMD:buy(playerid, params[])
{
    new idx = GetPlayerVirtualWorld(playerid)-100;
    if(idx > 0 && idx < MAX_BIZ && BizInfo[idx][bType] != 1 && BizInfo[idx][bType] != 2 && BizInfo[idx][bType] != 3 && BizInfo[idx][bType] != 4 && BizInfo[idx][bType] != 6 || idx < 1 || idx > MAX_BIZ) return SendClientMessage(playerid, COLOR_LIME, "You are not inside a business.");
    if(IsAt247(playerid) && BizInfo[idx][bType] == 1)
    {
        ShowPlayerDialog(playerid, STOREMENU, DIALOG_STYLE_LIST, "24/7", "Cell Phone        $400\nPhone Book        $4000\nDice         $400\nCondom        $40\nCD Player      $40\nSpraycan       $160\nRope          $800\nCigar         $40\nSprunk         $8\nVehicle Lock        $4000\nPortable Radio       $40000\nCamera          $160\nLottery Ticket        $800\nCheckbook     $400\nMask          $5000\nBoombox      $50000\nSuitCase        $10000", "Buy", "Cancel");
    }
    else if(BizInfo[idx][bType] == 3)
    {
        ShowPlayerDialog(playerid, AMMUMENU, DIALOG_STYLE_LIST, "Ammunation Shop", "Shotgun (5000)\nMp5 (20000)\nDeagle (35000)\nM4 (75000)\nFullVest (3000)", "Buy", "Cancel");
    }
    return 1;
}
Sorry I didn't read everything what you wrote this will work when you are in business or 24/7
Reply
#5

nope still not working
Reply
#6

please someone help me this is urgent
Reply
#7

Delete the IsPlayerInRangeOfPoint for the 24/7
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)