IsPlayerInCheckpoint
#1

Alright. Here's the problem. IsPlayerInCheckpoint isn't working. I need to know how to make it search if the Player is in range of 20 of these co-ordinates. (Yes I know how to use PlayerToPoint, I just don't want to make 17 different "if(PlayerToPoint etc.. etc..)
pawn Код:
{-997.6580, -2342.2607, 66.9098, 15.00},
    {-943.7073, -2398.8496, 71.2593, 15.00},
    {-982.7477, -2192.5598, 42.2947, 15.00},
    {-1412.6100, -2353.8291, 29.5624, 15.00},
    {-1423.0319, -2403.3794, 28.1239, 15.00},
    {-1471.7437, -2361.7427, 15.2878, 15.00},
    {-1533.2487, -2393.4695, 25.7835, 15.00},
    {-1472.2908, -2491.5576, 54.4205, 15.00},
    {-1417.9230, -2500.1687, 50.2386, 15.00},
    {-1297.1033, -2493.6528, 20.3028, 15.00},
    {-1302.6750, -2551.2512, 29.5823, 15.00},
    {-1384.9775, -2584.9612, 56.8318, 15.00},
    {-1491.2704, -2602.9346, 64.4876, 15.00},
    {-1593.4943, -2584.6423, 33.3475, 15.00},
    {-1599.4225, -2641.7747, 53.6445, 15.00},
    {-1645.2886, -2581.0225, 32.0714, 15.00},
    {-1667.9110, -2524.4089, 19.8952, 15.00},
    {-1736.7642, -2500.8762, 9.9368, 15.00}
pawn Код:
if (strcmp("/chop", cmdtext, true) == 0)
    {
    if (IsPlayerInCheckpoint(playerid))
    {
      if (GetPlayerWeapon(playerid) == 4)
        {
          SetTimerEx("KnifeChopTime", 4000, false, "i", playerid);
            TogglePlayerControllable(playerid, 0);
        }
    }
   
    else if (IsPlayerInCheckpoint(playerid))
    {
        SetTimerEx("ChopTime", 9000, false, "i", playerid);
        TogglePlayerControllable(playerid, 0);
    }
   
    else
    {
      new rand = random(sizeof(Woodcheckpoints));
        SetPlayerCheckpoint(playerid,Woodcheckpoints[rand][0],Woodcheckpoints[rand][1],Woodcheckpoints[rand][2],Woodcheckpoints[rand][3]);
    }
    return 1;
    }
EDIT: I need to sleep right now, please help me with any responses so I'll know what's going on by morning. Thanks*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)