isplayerinrangeofpoint
#1

Hay Mates.

Just a Quick Question, How would I Go about using "isplayerinrangeofpoint" For an Interior, /enter isnt ABSOLUTELY Neccesary, But Would i use

public isplayerinrangeofpoint ?

Or like

/enter
}
isplayerinrangeofpoint(aHDAHVSHDBASD)
(AFFECT)

Or What? Just a Quick awsnser is needed to get me started, Oh and please Try not to use DCMD, I Dont wanna learn that shit :P
Reply
#2

Код:
if(strcmp(cmdtext, "/enter", true) ==0)
{
   if(IsPlayerInRangeOfPoint(playerid, range, x,y,z))
   {
       Teleports etc.
   }
return 1;
}
Reply
#3

You need to capitalize it correctly, please refer to the wiki for the correct parameters for the actual function, instead of wasting your time and posting a thread.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

As you see, it shows a pretty useful example, it's used in conjunction with SendClientMessage. Using the example command, you could add some code to set the player's position to somewhere else, i.e: to enter a building.
Reply
#4

I prefer the IsPlayerInRange but that's up to each person.
Reply
#5

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
I prefer the IsPlayerInRange but that's up to each person.
He's not writing a command to compare the distance between players, he's writing a command to compare the distance between a position and the player. IsPlayerInRange isn't a native, either.
Reply
#6

I just mentioned it maybe he wants to check it out.

Anyway IsPlayerInRange isn't between players, it's almost the same as IsPlayerInRangeOfPoint only shorter and with more options

pawn Код:
IsPlayerInRange

Returns 1 if if they are, 0 if they aren't
Parameters:
(playerid, Float: Range, Float: Z_Range, Float:tar_x, Float:tar_y, Float:tar_z)
playerid    The playerid you want to query
Float:Range The range the player can be in
Float:Z_Range   The height range the player can be in
Float:tar_x The x value for the point
Float:tar_y The y value for the point
Float:tar_z The z value for the point
Returns 1 if they are in the range, 0 if they aren'
t
IsPlayerInRange(2, 2.0, 2.0, 4.0, 4.0, 4.0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)