SA-MP Forums Archive
Unknown command, why ? - 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: Unknown command, why ? (/showthread.php?tid=335676)



Unknown command, why ? - tal_peretz - 19.04.2012

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


Re: Unknown command, why ? - IstuntmanI - 19.04.2012

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, "!рйъп мдзреъ аъ дшлб щмк шч ббйъ щмк");



Re: Unknown command, why ? - tal_peretz - 19.04.2012

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.


Re: Unknown command, why ? - IstuntmanI - 19.04.2012

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.


Re: Unknown command, why ? - tal_peretz - 19.04.2012

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


Re: Unknown command, why ? - IstuntmanI - 19.04.2012

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.


Re: Unknown command, why ? - tal_peretz - 19.04.2012

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.