Radio[rep]
#1

i made an radio and i want so when i exit car the radio stops.. look..First help gets rep!if it works...

PHP код:
public OnPlayerExitVehicle(playeridvehicleid)
for(new 
ii<MAX_PLAYERSi++)
{
StopAudioStreamForPlayer(i);
}
}
return 
1;

PHP код:
2 errors:
error 054unmatched closing brace ("}")
error 010invalid function or declaration 
Reply
#2

try
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        StopAudioStreamForPlayer(i);
    }
    return 1;
}
Reply
#3

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        StopAudioStreamForPlayer(i);
    }
    return 1;
}
Edit: ok some1 was faster *
Reply
#4

I can't see why you're using a loop when playerid is already defined as a parameter on a public;
pawn Код:
public OnPlayerExitVehicle( playerid, vehicleid )
{
    StopAudioStreamForPlayer( playerid );
   
    return 1;
}
Reply
#5

Off-Topic: Da hell is up with your signature "Click here to see something cool" That scared my Sister like crazy!
Reply
#6

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
try
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        StopAudioStreamForPlayer(i);
    }
    return 1;
}
ok good il give you another chance soo u dont say im an noob..

if i go in range it spams.. liek you see in picture please help first help gets Rep!

PHP код:
public OnPlayerUpdate(playerid)
{
    if(!
IsPlayerConnected(playerid)) return 0;
    if(
IsPlayerNPC(playerid)) return 1;
    if(
GetPlayerInterior(playerid) == 0) {
        if(
IsPlayerInRangeOfPoint(playerid,70.0,1300.4093,-1868.7646,17.4449)) {
            if(!
GetPVarInt(playerid,"alhambra")) {
                
SetPVarInt(playerid,"alhambra",0);
                
PlayAudioStreamForPlayer(playerid"http://live.radioplayone.ro:9888/",1300.4093,-1868.7646,17.4449,70.0,true);
            }
        }
    }
    else {
        if(
GetPVarInt(playerid,"alhambra")) {
              
DeletePVar(playerid,"alhambra");
               
StopAudioStreamForPlayer(playerid);
        }
    }
    return 
1;

http://imageshack.us/photo/my-images/835/samp001pb.png/ see picture please!
Reply
#7

Like Toreno said, add stopaudiostreamforplayer on OnPlayerExitVehicle callback, no need to complicate it by using unnecessary loops.
Reply
#8

this is something else..i made the range one..and if i go in range it spams the radio...see picture
Reply
#9

something like this?
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    if(IsPlayerNPC(playerid)) return 1;
   
    new isnear;

    if(GetPlayerInterior(playerid) == 0 && isnear == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,70.0,1300.4093,-1868.7646,17.4449))
        {
            if(!GetPVarInt(playerid,"alhambra"))
            {
                SetPVarInt(playerid,"alhambra",0);
                isnear = 1;
                PlayAudioStreamForPlayer(playerid, "http://live.radioplayone.ro:9888/",1300.4093,-1868.7646,17.4449,70.0,true);
            }
        }
    }
    else
    {
        if(GetPVarInt(playerid,"alhambra"))
        {
              DeletePVar(playerid,"alhambra");
              StopAudioStreamForPlayer(playerid);
              isnear = 0;
        }
    }

    return 1;
}
Reply
#10

Quote:
Originally Posted by Toreno
Посмотреть сообщение
I can't see why you're using a loop when playerid is already defined as a parameter on a public;
pawn Код:
public OnPlayerExitVehicle( playerid, vehicleid )
{
    StopAudioStreamForPlayer( playerid );
   
    return 1;
}
ok i did it stops spaming but if i exitcar there i range so u see a bar there with range..i exitcar and i cant listem to that music..understand?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)