forward musicstall(playerid); |
SetTimer("musicstall", 1000, false); |
public musicstall(playerid) { if(IsPlayerInRangeOfPoint(playerid, 5.0,1478.8761,-1666.3502,14.5532)) { PlayAudioStreamForPlayer(playerid, "http://lackofstyle.com/mp3s/bing_lookalotlikexmas.mp3"); } } |
if(strcmp("/startmusicnearpoint", cmdtext, true, 10) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInRangeOfPoint(playerid, 5.0,1478.8761,-1666.3502,14.5532)) { PlayAudioStreamForPlayer(playerid, "http://lackofstyle.com/mp3s/bing_lookalotlikexmas.mp3"); } } return 1; }
SetTimerEx("musicstall", 1000, false,"d", playerid);
SetTimerEx("musicstall", 1000, false,"d", playerid); |
SetTimerEx("musicstall", 1000, true,"d", playerid);
public OnGameModeInit( )
{
SetTimer( "musicstall", 1000, false );
return 1;
}
forward musicstall( );
public musicstall( )
{
for( new p = 0; p < MAX_PLAYERS; p++ )
{
if( IsPlayerConnected( p ) && !IsPlayerNPC( p ) && IsPlayerInRangeOfPoint( p, 5.0,1478.8761, -1666.3502, 14.5532 ) )
{
PlayAudioStreamForPlayer( p, "http://lackofstyle.com/mp3s/bing_lookalotlikexmas.mp3" );
}
}
return 1;
}
SetTimer("musicstall", 1500, true); |
public musicstall() { for(new i = 1; i < MAX_PLAYERS; i++) { if(IsPlayerInRangeOfPoint(i, 5.0,1478.8761,-1666.3502,14.5532)) { PlayAudioStreamForPlayer(i, "http://adstorage.jamba.net/storage/view/325/0/ha/Have_Yourself_A_Merry_Litt1.mp3"); } } return 1; } |
new
bool:Play_Audio[ MAX_PLAYERS ]
;
public OnGameModeInit( )
{
SetTimer( "musicstall", 1000, true );
return 1;
}
public OnPlayerConnect( playerid )
{
Play_Audio[ playerid ] = false;
return 1;
}
forward musicstall( );
public musicstall( )
{
for( new p = 0; p < MAX_PLAYERS; p++ )
{
if( IsPlayerConnected( p ) && !IsPlayerNPC( p ) && IsPlayerInRangeOfPoint( p, 5.0,1478.8761, -1666.3502, 14.5532 ) )
{
if( Play_Audio[ p ] == true ) continue;
PlayAudioStreamForPlayer( p, "http://lackofstyle.com/mp3s/bing_lookalotlikexmas.mp3" );
Play_Audio[ p ] = true;
}
if( !IsPlayerInRangeOfPoint( p, 5.0,1478.8761, -1666.3502, 14.5532 ) ) Play_Audio[ p ] = false;
}
return 1;
}