I need help with GameTextForPlayer -
Bar12 - 03.02.2014
Someone can make me a this if he is in the position:
Код:
1555.2455,-1675.8218,16.1953
Код:
GameTextForPlayer(playerid, "Police Department", 5000, 2);
Re: I need help with GameTextForPlayer -
Bar12 - 03.02.2014
uppp
Re: I need help with GameTextForPlayer -
Wizz123 - 03.02.2014
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 2, 1555.2455,-1675.8218,16.1953))
{
GameTextForPlayer(playerid, "~b~Police Department", 5000, 2);
}
return 1;
}
Re: I need help with GameTextForPlayer -
Beckett - 03.02.2014
Use
OnPlayerUpdate callback and the
IsPlayerInRangeOfPoint goes like
Код:
(playerid, Float:range, Float:x, Float:y, Float:z)
So the whole code will be like this.
Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,1555.2455,-1675.8218,16.1953))
{
GameTextForPlayer(playerid,"* Police Department *",5000,2);
}
}
Quote:
This forum requires that you wait 240 seconds between posts. Please try again in 189 seconds.
|
Re: I need help with GameTextForPlayer -
Wizz123 - 03.02.2014
Quote:
Originally Posted by DaniceMcHarley
Use OnPlayerUpdate callback and the IsPlayerInRangeOfPoint goes like
Код:
(playerid, Float:range, Float:x, Float:y, Float:z)
So the whole code will be like this.
Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,1555.2455,-1675.8218,16.1953))
{
GameTextForPlayer(playerid,"* Police Department *",5000,2);
}
}
|
Lol why are you copying meh
Re: I need help with GameTextForPlayer -
Beckett - 03.02.2014
Quote:
Originally Posted by Wizz123
Lol why are you copying meh
|
Mhm, if you didn't notice I've just been waiting for the post timer to reload lol then suddenly saw your code, I'm sorry anyways.
Re: I need help with GameTextForPlayer -
Hoborific - 03.02.2014
That's fucking terrible practice, you should determine if they're outside and spawned and on one of those callbacks start a timer to check if his in the zone, I'd recommend using Incognitos Streamer include as it lets you define a dynamicarea instead of using isplayerinrangeofpoint and it gives you callbacks to use easily such as OnPlayerEnterDynamicArea/OnPlayerLeaveDynamicArea
Lets say I use that code, and I decide to add 3 more police stations to it, and some hospitals! shit lets add some stores and area51, lets add the naval base and maybe some other things! i'm now checking all those positions as high as over 30 times per second.