[Help] ProxDetectorS - Easy
#3

I use the callback to a timer

Код:
SetTimerEx("test1", 90000, true, "i", playerid);
then

Код:
CALLBACK: test1(playerid)
{
	new jName = INVALID_PLAYER_ID;
        if(ProxDetectorS(3,playerid,jName))
		{
                     Mensaje(jNombre,-1,"closest player message.");
		}
       Mensaje(playerid, -1, "i use the callback");
	return 1;
}
So, i can use a function to a timer?

Код:
stock ProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		GetPlayerPos(targetid, posx, posy, posz);
		tempposx = (oldposx -posx);
		tempposy = (oldposy -posy);
		tempposz = (oldposz -posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}
Reply


Messages In This Thread
[Help] ProxDetectorS - Easy - by Doniczzz - 24.11.2016, 18:21
Re: [Help] ProxDetectorS - Easy - by Abagail - 24.11.2016, 18:26
Respuesta: [Help] ProxDetectorS - Easy - by Doniczzz - 24.11.2016, 18:36
Re: Respuesta: [Help] ProxDetectorS - Easy - by Abagail - 24.11.2016, 18:43
Respuesta: [Help] ProxDetectorS - Easy - by Doniczzz - 24.11.2016, 18:53

Forum Jump:


Users browsing this thread: 1 Guest(s)