if(!IsPlayerInRangeOfPointEx(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
stock IsPlayerInRangeOfPointEx(playerid, Float:range, Float:x, Float:y, Float:z)
{
if(IsPlayerInAnyVehicle(playerid)) return IsCarInRangeOfPoint(GetPlayerVehicleID(playerid), range, x,y,z);
else return IsPlayerInRangeOfPoint(playerid, range, x,y,z);
}
stock IsCarInRangeOfPoint(vehicleid, Float:range, Float:x, Float:y, Float:z)
{
new Float:px,Float:py,Float:pz;
GetVehiclePos(vehicleid,px,py,pz);
px -= x;
py -= y;
pz -= z;
return ((px * px) + (py * py) + (pz * pz)) < (range * range);
}
if(!IsPlayerInRangeOfPointEx(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
Just use IsPlayerInRangeOfPoint, change
Код:
if(!IsPlayerInRangeOfPointEx(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"); Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"); |
that what I did first and the problem happend .. that why I made a check if player is in Vehicle and I checked the Vehicle pos... this is not the solution.
|
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"), 1;
Then replace
Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"); Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"), 1; If this still don't work, show us the entire command and scm function. |
GetPlayerInHouse( playerid ) returns a house ID only when you are in a house, loop in all houses and check if it's a house of that player, then set variable house to that house id.
|