PDA

View Full Version : message player in range of point


cssbart
01/08/2012, 07:40 PM
message player in range of point

is there such command for this or work around

HarlemSAMP
01/08/2012, 07:44 PM
If you want to just make a cmd or a text using IsPlayerInRangeOfPoint, yes you can set up the coords where you want the cmd to be working, maybe like /help, if it's not what you're asking be more descriptive.

EDIT: not sure if you asking for a example of IsPlayerInRangeOfPoint, but here an example:

CMD:help(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, x y z)
ShowPlayerDialog(playerid, yourdialogid, DIALOG_STYLE_LIST, "Help Menu", "BlahBla", "Ok", "Cancel";)
GivePlayerPenis(playerid, blowjob);
return 1;
}

cssbart
01/08/2012, 07:49 PM
no so you do /countdown and then only players in range of the start line get the count down in there chat

Ranama
01/08/2012, 07:55 PM
you get the point of where the start line is, then you loop through all players and see if the player is in range of that point, if they are you'll send them a message, that's how easy it is :)

cssbart
01/08/2012, 07:58 PM
how would i do this i know hot to sentmessageclient and IsPlayerInRangeOfPoint but i dont know how to do a loop

Ranama
01/08/2012, 08:10 PM
you will do a loop like this


for(new i = 0; i<MAX_PLAYERS; i++){//this will loop until i is bigger then max players and after each loop i will be one more
if(IsPlayerInRangeOfPoint(i, 50.0, x, y ,z){//instead of playerid you type i because the current playerid is i
SendClientMessage(i, COLOR_WHITE, "You hear the signal to start the race (change it as you want)");//send the mesage to the player with id i here to
}
}
//this is how you make everybody near the point hear it, but if you want it to countdown you'll have to set a timer for every second and then kill it when it have counted done.
SetTimer


Hope you understand

cssbart
01/08/2012, 08:22 PM
i understand but could you do it so it started a timer for that player which would be i