SA-MP Forums Archive
Making a teleport with inrange - 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: Making a teleport with inrange (/showthread.php?tid=308150)



Making a teleport with inrange - milanosie - 02.01.2012

Hello, simple (or not) question.

I know how to make a teleport on cmd but how to make it so that It can only be executed at one specific place?


Re: Making a teleport with inrange - milanosie - 02.01.2012

anyone?


Re: Making a teleport with inrange - Norck - 02.01.2012

Use IsPlayerInRangeOfPoint to check is player in specific place, for example:
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid,5.0,x,y,z))    // add your coordinates instead of x,y,z
{ // if distance from player to x,y,z more than 5
    SendClientMessage(playerid,-1,"You can't use this teleport in this location!");  // then send them a message
    return 1;
}