if(Deejay[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,487.4404,-2.0827,1002.3828))
{
if(GetPlayerInterior(playerid) == 17)
{
if(!GetPVarInt(playerid,"dj"))
{
new url[200], pname[124];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[200]", url)) return SendClientMessage(playerid,-1,"{00A1FF}Foloseste{FFFFFF}: /CMD") &&
SendClientMessage(playerid,-1,"good music!");
PlayAudioStreamForPlayer(playerid, url,487.2308,-14.0902,1000.6797, 100.0,true);
return 1;
}
}
else
{
if(GetPVarInt(playerid,"dj"))
{
StopAudioStreamForPlayer(playerid);
}
}
}
else return SendClientMessage(playerid,COLOR_RED,"Not at the buttons");
}
else return SendClientMessage(playerid,COLOR_RED,"Not an DJ");
return 1;
if(Deejay[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,487.4404,-2.0827,1002.3828)) // cords.
{
if(GetPlayerInterior(playerid) == 7) // Interior id.
{
if(!GetPVarInt(playerid,"dj"))
{
new url[200], pname[124];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[200]", url)) return SendClientMessage(playerid,-1,"{00A1FF}Foloseste{FFFFFF}: /CMD");
SendClientMessage(playerid,-1,"good music!");
PlayAudioStreamForPlayer(playerid, url,487.2308,-14.0902,1000.6797, 100.0,true);
SetPVarInt(playerid, "dj", 1);
return 1;
}
}
else
{
if(GetPVarInt(playerid,"dj"))
{
StopAudioStreamForPlayer(playerid);
}
}
}
else return SendClientMessage(playerid,COLOR_RED,"Not at the buttons");
}
else return SendClientMessage(playerid,COLOR_RED,"Not an DJ");
return 1;
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 7) // or whatever the id is.
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
PHP код:
|
if(Deejay[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,487.4404,-2.0827,1002.3828)) // cords.
{
if(GetPlayerInterior(playerid) == 7) // Interior id.
{
if(!GetPVarInt(playerid,"dj"))
{
new url[200], pname[124];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[200]", url)) return SendClientMessage(playerid,-1,"{00A1FF}Foloseste{FFFFFF}: /CMD");
SendClientMessage(playerid,-1,"good music!");
//PlayAudioStreamForAll(playerid, url,487.2308,-14.0902,1000.6797, 100.0,true);
PlayAudioStreamForRange(url, 100.0, 487.2308, -14.0902, 1000.6797, 7);
SetPVarInt(playerid, "dj", 1);
return 1;
}
}
else
{
if(GetPVarInt(playerid,"dj"))
{
StopAudioStreamForPlayer(playerid);
}
}
}
else return SendClientMessage(playerid,COLOR_RED,"Not at the buttons");
}
else return SendClientMessage(playerid,COLOR_RED,"Not an DJ");
return 1;
forward PlayAudioStreamForRange(url[], Float:range, Float:x, Float:y, Float:z, Interior);
public PlayAudioStreamForRange(url[], Float:range, Float:x, Float:y, Float:z, Interior)
{
for(new i = GetPlayerPoolSize(); i > -1; i--)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, range, x, y, z) && GetPlayerInterior(i) == Interior)
{
PlayAudioStreamForPlayer(i, url);
}
}
}
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 7) // or whatever the id is.
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 7) // or whatever the id is.
{
StopAudioStreamForPlayer(playerid);
}
else if(newinteriorid == 7)
{
PlayAudioStreamForPlayer(playerid, "http://7619.live.streamtheworld.com/977_HITS_SC");
}
return 1;
}
/// Up your script, Under defines ///
new StreamUrl[200];
new bool:StreamUrlUsed = false;
///////////////////////////////////////
if(Deejay[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,487.4404,-2.0827,1002.3828)) // cords.
{
if(GetPlayerInterior(playerid) == 7) // Interior id.
{
if(!GetPVarInt(playerid,"dj"))
{
new url[200], pname[124];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[200]", url)) return SendClientMessage(playerid,-1,"{00A1FF}Foloseste{FFFFFF}: /CMD");
SendClientMessage(playerid,-1,"good music!");
//PlayAudioStreamForAll(playerid, url,487.2308,-14.0902,1000.6797, 100.0,true);
PlayAudioStreamForRange(url, 100.0, 487.2308, -14.0902, 1000.6797, 7);
StreamUrlUsed = true;
format(StreamUrl, sizeof(StreamUrl), "%s", url);
SetPVarInt(playerid, "dj", 1);
return 1;
}
}
else
{
if(GetPVarInt(playerid,"dj"))
{
StopAudioStreamForPlayer(playerid);
}
}
}
else return SendClientMessage(playerid,COLOR_RED,"Not at the buttons");
}
else return SendClientMessage(playerid,COLOR_RED,"Not an DJ");
return 1;
forward PlayAudioStreamForRange(url[], Float:range, Float:x, Float:y, Float:z, Interior);
public PlayAudioStreamForRange(url[], Float:range, Float:x, Float:y, Float:z, Interior)
{
for(new i = GetPlayerPoolSize(); i > -1; i--)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, range, x, y, z) && GetPlayerInterior(i) == 7)
{
PlayAudioStreamForPlayer(i, url);
}
}
}
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 7) // or whatever the id is.
{
StopAudioStreamForPlayer(playerid);
}
else if(newinteriorid == 7)
{
if(StreamUrlUsed) return PlayAudioStreamForPlayer(playerid, StreamUrl);
PlayAudioStreamForPlayer(playerid, "http://7619.live.streamtheworld.com/977_HITS_SC");
}
return 1;
}
new StreamUrl[200];
new bool:StreamUrlUsed = false;
if(Deejay[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,100.0,487.4404,-2.0827,1002.3828)) // cords.
{
if(GetPlayerInterior(playerid) == 7) // Interior id.
{
if(!GetPVarInt(playerid,"dj"))
{
new url[200], pname[124];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[200]", url)) return SendClientMessage(playerid,-1,"{00A1FF}Foloseste{FFFFFF}: /CMD");
SendClientMessage(playerid,-1,"good music!");
//PlayAudioStreamForAll(playerid, url,487.2308,-14.0902,1000.6797, 100.0,true);
PlayAudioStreamForRange(url, 100.0, 487.2308, -14.0902, 1000.6797, 7);
StreamUrlUsed = true;
format(StreamUrl, sizeof(StreamUrl), "%s", url);
SetPVarInt(playerid, "dj", 1);
return 1;
}
}
else
{
if(GetPVarInt(playerid,"dj"))
{
StopAudioStreamForPlayer(playerid);
DeletePVar(playerid, "dj");
}
}
}
else return SendClientMessage(playerid,COLOR_RED,"Not at the buttons");
}
else return SendClientMessage(playerid,COLOR_RED,"Not an DJ");
return 1;
forward PlayAudioStreamForRange(url[], Float:range, Float:x, Float:y, Float:z, Interior);
public PlayAudioStreamForRange(url[], Float:range, Float:x, Float:y, Float:z, Interior)
{
for(new i = GetPlayerPoolSize(); i > -1; i--)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, range, x, y, z) && GetPlayerInterior(i) == 7)
{
StopAudioStreamForPlayer(i);
PlayAudioStreamForPlayer(i, url);
}
}
}
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if(oldinteriorid == 7) // or whatever the id is.
{
StopAudioStreamForPlayer(playerid);
}
else if(newinteriorid == 7)
{
if(StreamUrlUsed)
{
PlayAudioStreamForPlayer(playerid, StreamUrl);
return 1;
}
PlayAudioStreamForPlayer(playerid, "http://7619.live.streamtheworld.com/977_HITS_SC");
}
return 1;
}