Unknown command, why ?
#1

this check make me problam .. when it's false it return Unknown command instead of sending a message ..

PHP код:
    if(!IsPlayerInRangeOfPointEx(playeridRadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playeridred"!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"); 
PHP код:
stock IsPlayerInRangeOfPointEx(playeridFloat:rangeFloat:xFloat:yFloat:z)
{
if(
IsPlayerInAnyVehicle(playerid)) return IsCarInRangeOfPoint(GetPlayerVehicleID(playerid), rangex,y,z);
else return 
IsPlayerInRangeOfPoint(playeridrangex,y,z);
}
stock IsCarInRangeOfPoint(vehicleidFloat:rangeFloat:xFloat:yFloat: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);

When it's true everything work... what is the problem?

Thanks
Reply
#2

Just use IsPlayerInRangeOfPoint, change
Код:
if(!IsPlayerInRangeOfPointEx(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
with
Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
Reply
#3

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Just use IsPlayerInRangeOfPoint, change
Код:
if(!IsPlayerInRangeOfPointEx(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
with
Код:
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.
Reply
#4

Quote:
Originally Posted by tal_peretz
Посмотреть сообщение
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.
Then replace
Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
with
Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"), 1;
I think that scm function returns false.

If this still don't work, show us the entire command and scm function.
Reply
#5

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Then replace
Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");
with
Код:
if(!IsPlayerInRangeOfPoint(playerid, RadiusHouse(house), HouseFile[house][CheckPointX],HouseFile[house][CheckPointY],HouseFile[house][CheckPointZ])) return scm(playerid, red, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк"), 1;
I think that scm function returns false.

If this still don't work, show us the entire command and scm function.
I found the problem .. thank you alot
Reply
#6

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.
Reply
#7

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
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.
yes I saw the problem alone .. thanks anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)