Tiring Script And Scream Code

Started by Altay, Feb 07, 2020, 12:27 PM

Previous topic - Next topic

Altay

Hi my friends,
I am making a basic roleplay server so i am trying to make it realistic. First we now players can sprint infinite so i want them tired after 10 seconds of running. But i need a syntax for it. And the second thing if someone sends a message, that message should be seen only 15 meters from nearby players. So he will type "/scream Police, put your hands up!". This message will only be shown to players who are 15 meters in diameter. But I don't know something like "radius trigger". I am amateur. Thanks from now.
Mustafa Kemal ATATURK, the man who changed the course of history. https://en.wikipedia.org/wiki/Mustafa_Kemal_Atat%C3%BCrk

habi

hey brother, radius trigger is easy. use DistanceFromPoint( x1, y1, x2, y2 ) function.
if(cmd=="scream")
{
local i =0;
local nearplr;
local distance;
for( i=0;i<100;i++)
{
nearplr=FindPlayer(i);
if(nearplr)
{
distance = DistanceFromPoint( nearplr.Pos.x, nearplr.Pos.y, player.Pos.x, player.Pos.y );
if( distance < 15 )
{
MessagePlayer(player.Name+" screams: "+text, nearplr);
}
}
}
}