Little Help
#1

Guys i just wanna add ''50'' radius for the other players. Now when choose any case, all of server can hear the voice. I dont want this. I just need adding radius. Can you help ?

Код:
if(response)
    {
    switch(dialogid == 3030)
        {
                case 1:
            {
                switch(listitem)
                {
                    case 0://
                    {
for(new i = 0, j = GetMaxPlayers(); i < j; i++) {
	if(PlayAudioStreamForPlayer(i, "http://k004.kiwi6.com/hotlink/9rrqj92k8t/pitbull_suavemente_feat_nayer_mohombi_new_song_2011.mp3")) {
	}
}
                    }
Reply
#2

Add a loop...

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(i, X, Y, Z);
    if(IsPlayerInRangeOfPoint(playerid, 50, X, Y, Z)
    {
         // rest of your code here...
    }
}
Reply
#3

Thanks but, i do not understand one point.

if(IsPlayerInRangeOfPoint(playerid, 50, X, Y, Z)

X,Y,Z must i write some of cordinate on there?
Reply
#4

GetPlayerPos sets the X,Y,Z variables that we created in the line above, to some player's position.
Reply
#5

so its random point?
Reply
#6

The code above gets the position of every player (player is "i"). GetPlayerPos gets the position of "i" player, and X, Y, Z are the co-ordinates of that "i" player. Basically, it checks the position of every player online.
Reply
#7

Thanks for your help Gerira.. +rep
Reply
#8

Ah 1 sec, can you add this to on my code for show me the example ?

Код:
if(response)
    {
    switch(dialogid == 3030)
        {
                case 1:
            {
                switch(listitem)
                {
                    case 0://
                    {
for(new i = 0, j = GetMaxPlayers(); i < j; i++) {
	if(PlayAudioStreamForPlayer(i, "http://k004.kiwi6.com/hotlink/9rrqj92k8t/pitbull_suavemente_feat_nayer_mohombi_new_song_2011.mp3")) {
	}
}
                    }
                    case 1: //
                    {
And this is yours

Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(i, X, Y, Z);
    if(IsPlayerInRangeOfPoint(playerid, 50, X, Y, Z)
    {
         // rest of your code here...
    }
}
Can you consolidate them ?
Reply
#9

Nobody ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)