Hello, I cant get my /search command to work alright. It works on the first positions but when I want to be able to do /search at a plane, it dosent work.
Код:
CMD:search(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, 1246.7194,-3652.2080,3.7651) || IsPlayerInRangeOfPoint(playerid, 4.0,1248.8490,-3652.5339,3.9919) || IsPlayerInRangeOfPoint(playerid, 4.0,1249.7378,-3655.0664,4.1358) || IsPlayerInRangeOfPoint(playerid, 4.0,1247.8719,-3657.1309,3.9854) || IsPlayerInRangeOfPoint(playerid, 4.0,1244.9426,-3657.2202,3.6845) || IsPlayerInRangeOfPoint(playerid, 4.0, 1247.7538,-3649.2112,3.8104) || IsPlayerInRangeOfPoint(playerid, 4.0,1249.3942,-3650.7388,4.0113) ||
IsPlayerInRangeOfPoint(playerid, 4.0, 1252.5797,-3647.4241,4.2725) || IsPlayerInRangeOfPoint(playerid,4.0,1273.4034,-3637.6157,6.7242) || IsPlayerInRangeOfPoint(playerid, 4.0,1275.7910,-3638.0093,7.2448) || IsPlayerInRangeOfPoint(playerid,4.0,1273.6541,-3632.8669,6.7017) || IsPlayerInRangeOfPoint(playerid,4.0,1276.3198,-3632.5386,7.2707) || IsPlayerInRangeOfPoint(playerid,4.0,1249.0819,-3662.0967,4.2165) || IsPlayerInRangeOfPoint(playerid,4.0,1246.3524,-3665.5642,4.0018) ||
IsPlayerInRangeOfPoint(playerid,4.0,1246.3524,-3665.5642,4.0018) || IsPlayerInRangeOfPoint(playerid,4.0,1248.5748,-3666.4690,4.2499) || IsPlayerInRangeOfPoint(playerid,4.0, 1246.8364,-3668.2712,4.1074) || IsPlayerInRangeOfPoint(playerid,4.0,1251.7527,-3675.4429,4.7630) || IsPlayerInRangeOfPoint(playerid,4.0,1252.2264,-3678.0854,4.8663) || IsPlayerInRangeOfPoint(playerid,4.0,1255.0496,-3677.4768,5.1456) || IsPlayerInRangeOfPoint(playerid,4.0,1257.0099,-3676.6565,5.3314))
{
if(CantUseSearch[playerid] == 0)
{
if(PlayerInfo[playerid][pSlotsFree] == 20 && PlayerInfo[playerid][pBackPack] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "You dont have any room left in your backpack");
return 1;
}
if(PlayerInfo[playerid][pSlotsFree] == 50 && PlayerInfo[playerid][pBackPack] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You dont have any room left in your backpack");
return 1;
}
if(PlayerInfo[playerid][pSlotsFree] == 100 && PlayerInfo[playerid][pBackPack] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You dont have any room left in your backpack");
return 1;
}
if(PlayerInfo[playerid][pSlotsFree] == 150 && PlayerInfo[playerid][pBackPack] == 3)
{
SendClientMessage(playerid, COLOR_WHITE, "You dont have any room left in your backpack");
return 1;
}
new string[158];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s starts to search through the boxes", sendername);
ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~]]] Searching ]]]",15000,3);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("searchtimer", 15000, false, "i", playerid);
CantUseSearch[playerid] = 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 4.0,1519.0341,-3711.8696,32.9301) || IsPlayerInRangeOfPoint(playerid, 4.0,1515.8898,-3714.2627,31.9744) || IsPlayerInRangeOfPoint(playerid, 4.0,1516.0928,-3709.7856,32.2328) || IsPlayerInRangeOfPoint(playerid, 4.0, 1516.4968,-3709.2048,32.4523))
{
new string[158];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GameTextForPlayer(playerid, "You found heroin", 3500,5);
PlayerInfo[playerid][pHeroin] = 7;
format(string, sizeof(string), "%s founds some heroin in the plane", sendername);
ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
CantUseSearch[playerid] = 1;
SetTimerEx("CanUseSearch", 30000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, RED, "[Survival:RP] Please wait before using /search again");
}
}
else
{
SendClientMessage(playerid, RED, "[Survival:RP] You are not near the search place");
}
return 1;
}
It works fine with the top line, but when I try to search at the plane, it wont work