Command is not working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command is not working (
/showthread.php?tid=617411)
Command is not working -
StR_MaRy - 20.09.2016
hey i have a command and i want to be in that zone if you want to activate but here i can use it everywhere what is wrong ?
Код HTML:
CMD:joinrace(playerid, params[])
{
if(RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> Race already started! Wait first till race ends!");
if(RaceBusy == 0x00) return SendClientMessage(playerid, RED, "<!> There's no race to join!");
if(Joined[playerid] == true) return SendClientMessage(playerid, RED, "<!> You already joined a race!");
if(IsPlayerInAnyVehicle(playerid)) return SetTimerEx("SetupRaceForPlayer", 2500, 0, "e", playerid), RemovePlayerFromVehicle(playerid), Joined[playerid] = true;
if(PlayerInfo[playerid][pWanted] > 0) return SendClientMessage(playerid, COLOR_ERROR, "Ai deja un nivel de cautare ridicat, nu poti sa jefuiesti banca!");
if(IsPlayerInRangeOfPoint(playerid, 2.0, 245.5332,1797.5433,609.4073) && IsPlayerInRangeOfPoint(playerid, 2.0, 235.4332,1797.4471,609.4073)) return SendClientMessage(playerid, COLOR_ERROR, "Nu esti in locul potrivit.");
SetPlayerCheckpoint(playerid, 913.5962, -1003.4122, 38.0038, 4.0);
CP[playerid] = 1;
SetupRaceForPlayer(playerid);
Joined[playerid] = true;
return 1;
}
Re: Command is not working -
Vince - 20.09.2016
I suppose you need to invert the range checks?
Re: Command is not working -
StR_MaRy - 20.09.2016
no is ok the coords
Код HTML:
if(IsPlayerInRangeOfPoint(playerid, 2.0, 245.5332,1797.5433,609.4073) && IsPlayerInRangeOfPoint(playerid, 2.0, 235.4332,1797.4471,609.4073)) return SendClientMessage(playerid, COLOR_ERROR, "Nu esti in locul potrivit.");
but is working everywhere on the map , not only in those coords
EDIT:
done just needed to ADD this: ! in front of IsPlayerInRangeOfPoint