Or Commands ? :S - 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: Or Commands ? :S (
/showthread.php?tid=296620)
Or Commands ? :S -
Michael[NBK] - 12.11.2011
Hey,
I want to make a CMD:rob etc, So if i wanted to do a CMD:robshop(playerid,params)
I would need to use GetPlayerDistanceFromPoint, How can i make multiple versions of that? i was thinking
pawn Код:
CMD:robshop(playerid,params)
{
    if(GetPlayerDistanceFromPoint(playerid,X,Y,Z)) return SendError(playerid,"You are not in the shop");
    else if(GetPlayerDistanceFromPoint(playerid,X,Y,Z)) return SendError(playerid,"You are not in the shop");
    else if(GetPlayerDistanceFromPoint(playerid,X,Y,Z)) return SendError(playerid,"You are not in the shop");
    else
    {
    Rob Stuff Here
    }
    return 1;
}
But i really don't know well thanks in advance
Re: Or Commands ? :S -
antonio112 - 12.11.2011
Why not use the
IsPlayerInRangeOfPoint function? That's what it's been created for:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
And you can make:
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 10.0, X, Y, Z) || !IsPlayerInRangeOfPoint(playerid, 10.0, xX, yY, zZ))
    return SendClientMessage(playerid, -1, "You're not in a rob zone.");
// here continue code, if the player is in range of point
Re: Or Commands ? :S -
CSSI - 12.11.2011
Yeah Use IsPlayerInRangeOfPoint
pawn Код:
CMD:robshop(playerid,params)
Aren't u missing [] after params?