01.05.2014, 17:46
custom function i made
Eventhough it compiles it says i am not near the robbery point... which i actually am..
pawn Код:
IsPlayerNearAnyRobberyArea(playerid)
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 381.647399, -56.551239, 1001.515136) || IsPlayerInRangeOfPoint( playerid, 3.0, 810.491821, -1616.179199, 13.546875) || IsPlayerInRangeOfPoint( playerid, 3.0, 1070.025268, 249.608657, 536.092712) )
{
return true; //if player is near we will return true;
}
return false;
}
CMD:robstore(playerid,params[])
{
if(gteam[playerid] != TEAM_CIV) return SendClientMessage(playerid,COLOR_RED,"(Error): You must be civilian to use this command!");
if(!IsPlayerNearAnyRobberyArea(playerid)) return ErrorMessages(playerid,5);
if(GetPlayerWantedLevel(playerid) >= 3) return ErrorMessages(playerid,7);
if(alreadyrobbed[playerid] && gettime() < alreadyrobbed[playerid])return SendClientMessage(playerid,COLOR_RED,"(Error): You have already robbed a shop!Try Later!");
if(Player_CountDown[playerid] != -1) return SendClientMessage(playerid, COLOR_RED, "(Error): Please wait until the robbery you've started gets finished.");
Player_CountDown[playerid] = 30;
PlayerTimer_CountDown[playerid] = SetTimerEx("countdown", 1000, true, "i", playerid);
SetPlayerProgressBarValue(playerid,bar[playerid],0);
ShowPlayerProgressBar(playerid,bar[playerid]);
IncreasePlayerWantedLevel(playerid,4);
alreadyrobbed[playerid] = gettime() + 120;
SendClientMessage(playerid,-1," ("COL_GREEN"WAIT"COL_WHITE"): Please stay at the point for 30 seconds if you want the robbery to be completed!");
GameTextForPlayer(playerid,"~r~Starting Robbery!",1000,6);
return 1;
}