29.08.2012, 12:40
(
Last edited by tallerin; 29/08/2012 at 01:26 PM.
)
Heres an example of how to do it. sounds like you only need the if(!PlayerInRangeOfPoint part so use it with your x y z cords the first # 2.2 is the range to be within change it to your range you want them to be in for the dialog to open the next 3 # are your x y z cords. The !PlayerInRangeOfPoint(playerid,range,x,y,z prevents them from opening the locker from anywhere they want so when there at diff cords they will get the msg you aren't near your locker, but when they are at the set cords it will open the dialog.
pawn Code:
CMD:locker(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(IsACop(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.2,256.2174,77.3295,1004.0344)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
ShowDialog(playerid, 5);
}