I need help with GameTextForPlayer
#1

Someone can make me a this if he is in the position:
Код:
1555.2455,-1675.8218,16.1953
Код:
GameTextForPlayer(playerid, "Police Department", 5000, 2);
Reply
#2

uppp
Reply
#3

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 2, 1555.2455,-1675.8218,16.1953))
    {
        GameTextForPlayer(playerid, "~b~Police Department", 5000, 2);
    }    
    return 1;
}
Reply
#4

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.
Reply
#5

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
Reply
#6

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.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)