Originally Posted by [RiFA
Artix ]
a little bit more explaination would be nice ![]() i say i dont know how to do it. and you only say that ? /Artix |
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:temPposx, Float:temPposy, Float:temPposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
temPposx = (oldposx -x);
temPposy = (oldposy -y);
temPposz = (oldposz -z);
if (((temPposx < radi) && (temPposx > -radi)) && ((temPposy < radi) && (temPposy > -radi)) && ((temPposz < radi) && (temPposz > -radi)))
{
return 1;
}
//----------------------------------------------------------------------------------------------------------------------------speedo
/*new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z);
if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{ return true; }*/
//-----------------------------------------------------------------------------------------------------------------------stop speedo
return 0;
}
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public IsPlayerNearClub(playerid)
{
if(PlayerToPoint(50.0,playerid,your x,your y,your z)) // change the radius (50.0) if needed, and the coцrdinates ofcourse
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
PlayerPlaySound(playerid, 1139, X, Y, Z); // change the sound to what you would prefer (1139)
}
return 1;
}
SetTimer("IsPlayerNearClub(playerid)",1000,1); //1000 is checking every second
KillTimer(IsPlayerNearClub(playerid));