Help please ;)
#7

Quote:
Originally Posted by ScRipTeRi
Посмотреть сообщение
try this
pawn Код:
#include <a_samp>

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward PlayMuzic(playerid);


public OnGameModeInit()
{
    SetTimer("PlayMuzic", 999, true);
    return 1;
}

public PlayMuzic(playerid)
{
if(PlayerToPoint(1, playerid, x, y, z)
{
PlayAudioStreamForPlayer(playerid,"MUSIC HERE");
}
return 1;
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
    {
    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;
    }
    }
    return 0;
}
its not tested.

EDIT: To late
Hmm, for what i need that "PlayerToPoint"? how that helps me? i just want the music playing when i'm at that point..
Reply


Messages In This Thread
Help please ;) - by BarFix - 07.01.2014, 14:18
Re: Help please ;) - by ScRipTeRi - 07.01.2014, 14:20
Re: Help please ;) - by AIped - 07.01.2014, 14:21
Re: Help please ;) - by BarFix - 07.01.2014, 14:24
Re: Help please ;) - by ScRipTeRi - 07.01.2014, 14:25
Re: Help please ;) - by AIped - 07.01.2014, 14:28
Re: Help please ;) - by BarFix - 07.01.2014, 14:29
Re: Help please ;) - by offon - 07.01.2014, 14:34
Re: Help please ;) - by Konstantinos - 07.01.2014, 14:36
Re: Help please ;) - by AIped - 07.01.2014, 14:51

Forum Jump:


Users browsing this thread: 1 Guest(s)