zcmd pra strcmp -
TmZ - 15.08.2014
Код:
Boombox[MAX_PLAYERS];
new gPlayerLoggin[MAX_PLAYERS char];
#define COLOR_LIGHTBLUE 0x00C3FFFF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_LIME 0x00FF33FF
#define COLOR_GREY 0xAFAFAFFF
#define COL_WHITE "{FFFFFF}"
#define COL_LBLUE "{00C3FF}"
#define COL_RED "{FF0000}"
#define COL_LIME "{00FF33}"
#define COLOR_PURPLE 0xC2A2DAAA
public OnPlayerEnterDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
if(GetPVarType(i, "BBArea"))
{
if(areaid == GetPVarInt(i, "BBArea"))
{
new station[256];
GetPVarString(i, "BBStation", station, sizeof(station));
if(!isnull(station))
{
PlayStream(playerid, station, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ"), 30.0, 1);
SCM(playerid, -1, "You have entered an boombox area");
}
return 1;
}
}
}
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
if(GetPVarType(i, "BBArea"))
{
if(areaid == GetPVarInt(i, "BBArea"))
{
StopStream(playerid);
SCM(playerid, -1, "You have left the boombox area");
return 1;
}
}
}
return 1;
}
stock StopStream(playerid)
{
DeletePVar(playerid, "pAudioStream");
StopAudioStreamForPlayer(playerid);
}
stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
if(GetPVarType(playerid, "pAudioStream")) StopAudioStreamForPlayer(playerid);
else SetPVarInt(playerid, "pAudioStream", 1);
PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
}
stock PickUpBoombox(playerid)
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopStream(i);
}
}
DeletePVar(playerid, "BBArea");
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
DeletePVar(playerid, "PlacedBB"); DeletePVar(playerid, "BBLabel");
DeletePVar(playerid, "BBX"); DeletePVar(playerid, "BBY"); DeletePVar(playerid, "BBZ");
DeletePVar(playerid, "BBInt");
DeletePVar(playerid, "BBVW");
DeletePVar(playerid, "BBStation");
return 1;
}
stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:ix, Float:iy, Float:iz;
new Float:cx, Float:cy, Float:cz;
foreach(Player, i)
{
if(gPlayerLoggin{i})
{
if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
GetPlayerPos(i, ix, iy, iz);
cx = (x - ix);
cy = (y - iy);
cz = (z - iz);
if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
{
SCM(i, col1, string);
}
else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
{
SCM(i, col2, string);
}
else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
{
SCM(i, col3, string);
}
else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
{
SCM(i, col4, string);
}
else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
{
SCM(i, col5, string);
}
}
}
}
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
gPlayerLoggin{playerid} = 1;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(GetPVarType(playerid, "PlacedBB"))
{
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
if(GetPVarType(playerid, "BBArea"))
{
foreach(Player,i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopAudioStreamForPlayer(i);
SCM(i, COLOR_LIGHTBLUE, " The boombox creator has disconnected from the server.");
}
}
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_BOOMBOX)
{
if(!response)
{
SCM(playerid, COLOR_WHITE, " You cancel the Radio Station");
return 1;
}
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX1,DIALOG_STYLE_LIST,"Jazz","Smooth Jazz\nCrooze Jazz","Select","Cancel");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_LIST,"Pop","Power FM\nCharHitz","Select","Cancel");
}
case 2:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX3,DIALOG_STYLE_LIST,"Rap","RadioUP #1\nFlow 103 Rap","Select","Cancel");
}
case 3:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX4,DIALOG_STYLE_LIST,"Hip Hop","Hot 108 Jamz\nThe Beat #1","Select","Cancel");
}
case 4:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX5,DIALOG_STYLE_LIST,"Rock","Radio Paradise\nNoise FM","Select","Cancel");
}
case 5:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX6,DIALOG_STYLE_LIST,"Country","181 Kicking Country\nAbsolute Country Radio","Select","Cancel");
}
case 6:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX7,DIALOG_STYLE_INPUT, "Boombox Input URL", "Please put a Music URL to play the Music", "Play", "Cancel");
}
case 7:
{
if(GetPVarType(playerid, "BBArea"))
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "* %s has turned off their boombox.", pName);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopStream(i);
}
}
DeletePVar(playerid, "BBStation");
}
SCM(playerid, COLOR_WHITE, "You've turn off your boombox");
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX1)//JAZZ
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=146931", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=146931");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX2)//POP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13448", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13448");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX3)//RAP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX4)//HIP HOP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=105867", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=105867");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX5)//ROCK
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=785339", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=785339");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=19275", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=19275");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX6)//COUNTRY
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=71887", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=71887");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=34839", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=34839");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX7)//SET URL
{
if(response == 1)
{
if(isnull(inputtext))
{
SCM(playerid, COLOR_WHITE, "You did not enter anything" );
return 1;
}
if(strlen(inputtext))
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, inputtext, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", inputtext);
}
}
}
else
{
return 1;
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
CMD:bbhelp(playerid, params[])
{
SCM(playerid, -1, "[Boombox Commands]: /placeboombox /pickupboombox /setboombox");
return 1;
}
CMD:abhelp(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_WHITE, "You are not authorized to use this command");
SCM(playerid, -1, "[Boombox Commands]: /giveboombox");
return 1;
}
CMD:giveboombox(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_WHITE, "You are not authorized to use this command");
new targetid, string[128], pname[MAX_PLAYER_NAME];
if(sscanf(params,"u", targetid)) return SCM(playerid, COLOR_WHITE, "USAGE:/giveboombox [playerid]");
Boombox[targetid] = 1;
GetPlayerName(targetid, pname, sizeof(pname));
format(string, sizeof(string), "You Have Given %s a Boombox", pname);
SCM(playerid, COLOR_LIGHTBLUE, string);
SCM(targetid, COLOR_LIGHTBLUE, "You have been given a boombox by an administrator(/bbhelp)");
return 1;
}
CMD:placeboombox(playerid, params[])
{
new string[128], Float:BBCoord[4], pName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, BBCoord[0], BBCoord[1], BBCoord[2]);
GetPlayerFacingAngle(playerid, BBCoord[3]);
SetPVarFloat(playerid, "BBX", BBCoord[0]);
SetPVarFloat(playerid, "BBY", BBCoord[1]);
SetPVarFloat(playerid, "BBZ", BBCoord[2]);
GetPlayerName(playerid, pName, sizeof(pName));
BBCoord[0] += (2 * floatsin(-BBCoord[3], degrees));
BBCoord[1] += (2 * floatcos(-BBCoord[3], degrees));
BBCoord[2] -= 1.0;
if(Boombox[playerid] == 0) return SCM(playerid, COLOR_WHITE, "You don't have a Boombox - Ask a Admin for one");
if(GetPVarInt(playerid, "PlacedBB")) return SCM(playerid, -1, "You already placed a Boombox - use /pickupboombox");
foreach(Player, i)
{
if(GetPVarType(i, "PlacedBB"))
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ")))
{
SCM(playerid, COLOR_WHITE, "You cannot put your boombox in this Radius as their is already one placed in this radius");
return 1;
}
}
}
new string2[128];
format(string2, sizeof(string2), "%s has placed down an boombox!", pName);
SendNearbyMessage(playerid, 15, string2, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPVarInt(playerid, "PlacedBB", CreateDynamicObject(2226, BBCoord[0], BBCoord[1], BBCoord[2], 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
format(string, sizeof(string), "Boombox Owner: %s\nUse /setboombox to set your boombox\n/pickupboombox to Pick up your boombox", pName);
SetPVarInt(playerid, "BBLabel", _:CreateDynamic3DTextLabel(string, -1, BBCoord[0], BBCoord[1], BBCoord[2]+0.6, 5, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBArea", CreateDynamicSphere(BBCoord[0], BBCoord[1], BBCoord[2], 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBInt", GetPlayerInterior(playerid));
SetPVarInt(playerid, "BBVW", GetPlayerVirtualWorld(playerid));
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
return 1;
}
CMD:setboombox(playerid, params[])
{
if(GetPVarType(playerid, "PlacedBB"))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ")))
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
else
{
return SCM(playerid, -1, "You're not near in your BoomBox!");
}
}
else
{
SCM(playerid, -1, " You don't have a boombox placed down!");
}
return 1;
}
CMD:pickupboombox(playerid, params [])
{
if(!GetPVarInt(playerid, "PlacedBB"))
{
SCM(playerid, -1, "You haven't placed a Boombox!");
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ")))
{
PickUpBoombox(playerid);
SCM(playerid, -1, "Boombox picked up successfully.");
}
return 1;
}
Alguйm converte pra mim

?
Re: zcmd pra strcmp -
zSuYaNw - 15.08.2014
Cara, para converter basta fazer isto:
aperte CTRL+H e digite no primeiro campo
CMD: e no segundo
if(!strcmp(cmdtext, "/ e aperte
ENTER.
depois aperte CTRL+H
(playerid, params []) e no segundo campo:
", true))"
Coloque esses comandos no "OnPlayerCommandText"
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]){
// cole aqui.
return true;
}
Re: zcmd pra strcmp -
TmZ - 15.08.2014
C:\Users\filterscripts\bbox.pwn(709) : error 021: symbol already defined: "zcmd_OnPlayerCommandText"
C:\Users\filterscripts\bbox.pwn(710) : error 037: invalid string (possibly non-terminated string)
C:\Users\filterscripts\bbox.pwn(716) : error 037: invalid string (possibly non-terminated string)
C:\Users\filterscripts\bbox.pwn(723) : error 037: invalid string (possibly non-terminated string)
C:\Users\filterscripts\bbox.pwn(727) : error 017: undefined symbol "params"
C:\Users\filterscripts\bbox.pwn(736) : error 037: invalid string (possibly non-terminated string)
C:\Users\filterscripts\bbox.pwn(775) : error 037: invalid string (possibly non-terminated string)
C:\Users\filterscripts\bbox.pwn(795) : error 037: invalid string (possibly non-terminated string)
C:\Users\filterscripts\bbox.pwn(80

: error 030: compound statement not closed at the end of file (started at line 710)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Errors.
deu esse erros aн man
Re: zcmd pra strcmp -
zSuYaNw - 15.08.2014
poste o cуdigo..
Re: zcmd pra strcmp -
TmZ - 15.08.2014
Код:
Boombox[MAX_PLAYERS];
new gPlayerLoggin[MAX_PLAYERS char];
#define COLOR_LIGHTBLUE 0x00C3FFFF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_LIME 0x00FF33FF
#define COLOR_GREY 0xAFAFAFFF
#define COL_WHITE "{FFFFFF}"
#define COL_LBLUE "{00C3FF}"
#define COL_RED "{FF0000}"
#define COL_LIME "{00FF33}"
#define COLOR_PURPLE 0xC2A2DAAA
public OnPlayerEnterDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
if(GetPVarType(i, "BBArea"))
{
if(areaid == GetPVarInt(i, "BBArea"))
{
new station[256];
GetPVarString(i, "BBStation", station, sizeof(station));
if(!isnull(station))
{
PlayStream(playerid, station, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ"), 30.0, 1);
SCM(playerid, -1, "You have entered an boombox area");
}
return 1;
}
}
}
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
if(GetPVarType(i, "BBArea"))
{
if(areaid == GetPVarInt(i, "BBArea"))
{
StopStream(playerid);
SCM(playerid, -1, "You have left the boombox area");
return 1;
}
}
}
return 1;
}
stock StopStream(playerid)
{
DeletePVar(playerid, "pAudioStream");
StopAudioStreamForPlayer(playerid);
}
stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
if(GetPVarType(playerid, "pAudioStream")) StopAudioStreamForPlayer(playerid);
else SetPVarInt(playerid, "pAudioStream", 1);
PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
}
stock PickUpBoombox(playerid)
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopStream(i);
}
}
DeletePVar(playerid, "BBArea");
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
DeletePVar(playerid, "PlacedBB"); DeletePVar(playerid, "BBLabel");
DeletePVar(playerid, "BBX"); DeletePVar(playerid, "BBY"); DeletePVar(playerid, "BBZ");
DeletePVar(playerid, "BBInt");
DeletePVar(playerid, "BBVW");
DeletePVar(playerid, "BBStation");
return 1;
}
stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:ix, Float:iy, Float:iz;
new Float:cx, Float:cy, Float:cz;
foreach(Player, i)
{
if(gPlayerLoggin{i})
{
if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
GetPlayerPos(i, ix, iy, iz);
cx = (x - ix);
cy = (y - iy);
cz = (z - iz);
if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
{
SCM(i, col1, string);
}
else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
{
SCM(i, col2, string);
}
else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
{
SCM(i, col3, string);
}
else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
{
SCM(i, col4, string);
}
else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
{
SCM(i, col5, string);
}
}
}
}
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
gPlayerLoggin{playerid} = 1;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(GetPVarType(playerid, "PlacedBB"))
{
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
if(GetPVarType(playerid, "BBArea"))
{
foreach(Player,i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopAudioStreamForPlayer(i);
SCM(i, COLOR_LIGHTBLUE, " The boombox creator has disconnected from the server.");
}
}
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_BOOMBOX)
{
if(!response)
{
SCM(playerid, COLOR_WHITE, " You cancel the Radio Station");
return 1;
}
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX1,DIALOG_STYLE_LIST,"Jazz","Smooth Jazz\nCrooze Jazz","Select","Cancel");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_LIST,"Pop","Power FM\nCharHitz","Select","Cancel");
}
case 2:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX3,DIALOG_STYLE_LIST,"Rap","RadioUP #1\nFlow 103 Rap","Select","Cancel");
}
case 3:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX4,DIALOG_STYLE_LIST,"Hip Hop","Hot 108 Jamz\nThe Beat #1","Select","Cancel");
}
case 4:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX5,DIALOG_STYLE_LIST,"Rock","Radio Paradise\nNoise FM","Select","Cancel");
}
case 5:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX6,DIALOG_STYLE_LIST,"Country","181 Kicking Country\nAbsolute Country Radio","Select","Cancel");
}
case 6:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX7,DIALOG_STYLE_INPUT, "Boombox Input URL", "Please put a Music URL to play the Music", "Play", "Cancel");
}
case 7:
{
if(GetPVarType(playerid, "BBArea"))
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "* %s has turned off their boombox.", pName);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopStream(i);
}
}
DeletePVar(playerid, "BBStation");
}
SCM(playerid, COLOR_WHITE, "You've turn off your boombox");
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX1)//JAZZ
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=146931", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=146931");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX2)//POP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13448", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13448");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX3)//RAP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX4)//HIP HOP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=105867", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=105867");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX5)//ROCK
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=785339", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=785339");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=19275", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=19275");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX6)//COUNTRY
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=71887", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=71887");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=34839", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=34839");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX7)//SET URL
{
if(response == 1)
{
if(isnull(inputtext))
{
SCM(playerid, COLOR_WHITE, "You did not enter anything" );
return 1;
}
if(strlen(inputtext))
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, inputtext, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", inputtext);
}
}
}
else
{
return 1;
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
CMD:bbhelp(playerid, params[])
{
SCM(playerid, -1, "[Boombox Commands]: /placeboombox /pickupboombox /setboombox");
return 1;
}
CMD:abhelp(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_WHITE, "You are not authorized to use this command");
SCM(playerid, -1, "[Boombox Commands]: /giveboombox");
return 1;
}
CMD:giveboombox(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_WHITE, "You are not authorized to use this command");
new targetid, string[128], pname[MAX_PLAYER_NAME];
if(sscanf(params,"u", targetid)) return SCM(playerid, COLOR_WHITE, "USAGE:/giveboombox [playerid]");
Boombox[targetid] = 1;
GetPlayerName(targetid, pname, sizeof(pname));
format(string, sizeof(string), "You Have Given %s a Boombox", pname);
SCM(playerid, COLOR_LIGHTBLUE, string);
SCM(targetid, COLOR_LIGHTBLUE, "You have been given a boombox by an administrator(/bbhelp)");
return 1;
}
CMD:placeboombox(playerid, params[])
{
new string[128], Float:BBCoord[4], pName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, BBCoord[0], BBCoord[1], BBCoord[2]);
GetPlayerFacingAngle(playerid, BBCoord[3]);
SetPVarFloat(playerid, "BBX", BBCoord[0]);
SetPVarFloat(playerid, "BBY", BBCoord[1]);
SetPVarFloat(playerid, "BBZ", BBCoord[2]);
GetPlayerName(playerid, pName, sizeof(pName));
BBCoord[0] += (2 * floatsin(-BBCoord[3], degrees));
BBCoord[1] += (2 * floatcos(-BBCoord[3], degrees));
BBCoord[2] -= 1.0;
if(Boombox[playerid] == 0) return SCM(playerid, COLOR_WHITE, "You don't have a Boombox - Ask a Admin for one");
if(GetPVarInt(playerid, "PlacedBB")) return SCM(playerid, -1, "You already placed a Boombox - use /pickupboombox");
foreach(Player, i)
{
if(GetPVarType(i, "PlacedBB"))
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ")))
{
SCM(playerid, COLOR_WHITE, "You cannot put your boombox in this Radius as their is already one placed in this radius");
return 1;
}
}
}
new string2[128];
format(string2, sizeof(string2), "%s has placed down an boombox!", pName);
SendNearbyMessage(playerid, 15, string2, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPVarInt(playerid, "PlacedBB", CreateDynamicObject(2226, BBCoord[0], BBCoord[1], BBCoord[2], 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
format(string, sizeof(string), "Boombox Owner: %s\nUse /setboombox to set your boombox\n/pickupboombox to Pick up your boombox", pName);
SetPVarInt(playerid, "BBLabel", _:CreateDynamic3DTextLabel(string, -1, BBCoord[0], BBCoord[1], BBCoord[2]+0.6, 5, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBArea", CreateDynamicSphere(BBCoord[0], BBCoord[1], BBCoord[2], 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBInt", GetPlayerInterior(playerid));
SetPVarInt(playerid, "BBVW", GetPlayerVirtualWorld(playerid));
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
return 1;
}
CMD:setboombox(playerid, params[])
{
if(GetPVarType(playerid, "PlacedBB"))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ")))
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
else
{
return SCM(playerid, -1, "You're not near in your BoomBox!");
}
}
else
{
SCM(playerid, -1, " You don't have a boombox placed down!");
}
return 1;
}
CMD:pickupboombox(playerid, params [])
{
if(!GetPVarInt(playerid, "PlacedBB"))
{
SCM(playerid, -1, "You haven't placed a Boombox!");
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ")))
{
PickUpBoombox(playerid);
SCM(playerid, -1, "Boombox picked up successfully.");
}
return 1;
}
Re: zcmd pra strcmp -
zSuYaNw - 15.08.2014
Convertendo de ZCMD para STRCMP:
vejamos meu comando:
pawn Код:
CMD:meucomando(playerid, params[]){
SendClientMessage(playerid, -1, "Este й meu comando!");
return true;
}
Para converter, troque o CMD: por if(!strcmp(cmdtext, "/ Ficando assim:
pawn Код:
if(!strcmp(cmdtext, "/meucomando", true)){
SendClientMessage(playerid, -1, "Este й meu comando!");
return true;
}
Agora jogue este comando na Callback OnPlayerCommandText, FICANDO:
pawn Код:
public OnPlayerCommandText(playerid, params[]){
if(!strcmp(cmdtext, "/meucomando", true)){
SendClientMessage(playerid, -1, "Este й meu comando!");
return true;
}
return false;
}
Re: zcmd pra strcmp -
TmZ - 15.08.2014
vei, jб estar assim, o problema й os params lб
Re: zcmd pra strcmp -
zSuYaNw - 15.08.2014
Troca params por cmdtext.
Re: zcmd pra strcmp -
TmZ - 15.08.2014
to falando disso aqui cara " if(sscanf(params,"u", targetid)) return SCM(playerid, COLOR_WHITE, "USAGE:/giveboombox [playerid]");"
Respuesta: zcmd pra strcmp -
Tirael - 15.08.2014
pawn Код:
Boombox[MAX_PLAYERS];
new gPlayerLoggin[MAX_PLAYERS char];
#define COLOR_LIGHTBLUE 0x00C3FFFF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_LIME 0x00FF33FF
#define COLOR_GREY 0xAFAFAFFF
#define COL_WHITE "{FFFFFF}"
#define COL_LBLUE "{00C3FF}"
#define COL_RED "{FF0000}"
#define COL_LIME "{00FF33}"
#define COLOR_PURPLE 0xC2A2DAAA
public OnPlayerEnterDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
if(GetPVarType(i, "BBArea"))
{
if(areaid == GetPVarInt(i, "BBArea"))
{
new station[256];
GetPVarString(i, "BBStation", station, sizeof(station));
if(!isnull(station))
{
PlayStream(playerid, station, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ"), 30.0, 1);
SCM(playerid, -1, "You have entered an boombox area");
}
return 1;
}
}
}
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
foreach(Player, i)
{
if(GetPVarType(i, "BBArea"))
{
if(areaid == GetPVarInt(i, "BBArea"))
{
StopStream(playerid);
SCM(playerid, -1, "You have left the boombox area");
return 1;
}
}
}
return 1;
}
stock StopStream(playerid)
{
DeletePVar(playerid, "pAudioStream");
StopAudioStreamForPlayer(playerid);
}
stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
if(GetPVarType(playerid, "pAudioStream")) StopAudioStreamForPlayer(playerid);
else SetPVarInt(playerid, "pAudioStream", 1);
PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
}
stock PickUpBoombox(playerid)
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopStream(i);
}
}
DeletePVar(playerid, "BBArea");
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
DeletePVar(playerid, "PlacedBB"); DeletePVar(playerid, "BBLabel");
DeletePVar(playerid, "BBX"); DeletePVar(playerid, "BBY"); DeletePVar(playerid, "BBZ");
DeletePVar(playerid, "BBInt");
DeletePVar(playerid, "BBVW");
DeletePVar(playerid, "BBStation");
return 1;
}
stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:ix, Float:iy, Float:iz;
new Float:cx, Float:cy, Float:cz;
foreach(Player, i)
{
if(gPlayerLoggin{i})
{
if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
GetPlayerPos(i, ix, iy, iz);
cx = (x - ix);
cy = (y - iy);
cz = (z - iz);
if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
{
SCM(i, col1, string);
}
else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
{
SCM(i, col2, string);
}
else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
{
SCM(i, col3, string);
}
else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
{
SCM(i, col4, string);
}
else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
{
SCM(i, col5, string);
}
}
}
}
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
gPlayerLoggin{playerid} = 1;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(GetPVarType(playerid, "PlacedBB"))
{
DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
if(GetPVarType(playerid, "BBArea"))
{
foreach(Player,i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopAudioStreamForPlayer(i);
SCM(i, COLOR_LIGHTBLUE, " The boombox creator has disconnected from the server.");
}
}
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/bbhelp", cmdtext, true, 10) == 0)
{
SCM(playerid, -1, "[Boombox Commands]: /placeboombox /pickupboombox /setboombox");
return 1;
}
if (strcmp("/abhelp", cmdtext, true, 10) == 0)
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_WHITE, "You are not authorized to use this command");
SCM(playerid, -1, "[Boombox Commands]: /giveboombox");
return 1;
}
if (strcmp("/giveboombox", cmdtext, true, 10) == 0)
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_WHITE, "You are not authorized to use this command");
new targetid, string[128], pname[MAX_PLAYER_NAME];
if(sscanf(params,"u", targetid)) return SCM(playerid, COLOR_WHITE, "USAGE:/giveboombox [playerid]");
Boombox[targetid] = 1;
GetPlayerName(targetid, pname, sizeof(pname));
format(string, sizeof(string), "You Have Given %s a Boombox", pname);
SCM(playerid, COLOR_LIGHTBLUE, string);
SCM(targetid, COLOR_LIGHTBLUE, "You have been given a boombox by an administrator(/bbhelp)");
return 1;
}
if (strcmp("/placeboombox", cmdtext, true, 10) == 0)
{
new string[128], Float:BBCoord[4], pName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, BBCoord[0], BBCoord[1], BBCoord[2]);
GetPlayerFacingAngle(playerid, BBCoord[3]);
SetPVarFloat(playerid, "BBX", BBCoord[0]);
SetPVarFloat(playerid, "BBY", BBCoord[1]);
SetPVarFloat(playerid, "BBZ", BBCoord[2]);
GetPlayerName(playerid, pName, sizeof(pName));
BBCoord[0] += (2 * floatsin(-BBCoord[3], degrees));
BBCoord[1] += (2 * floatcos(-BBCoord[3], degrees));
BBCoord[2] -= 1.0;
if(Boombox[playerid] == 0) return SCM(playerid, COLOR_WHITE, "You don't have a Boombox - Ask a Admin for one");
if(GetPVarInt(playerid, "PlacedBB")) return SCM(playerid, -1, "You already placed a Boombox - use /pickupboombox");
foreach(Player, i)
{
if(GetPVarType(i, "PlacedBB"))
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "BBX"), GetPVarFloat(i, "BBY"), GetPVarFloat(i, "BBZ")))
{
SCM(playerid, COLOR_WHITE, "You cannot put your boombox in this Radius as their is already one placed in this radius");
return 1;
}
}
}
new string2[128];
format(string2, sizeof(string2), "%s has placed down an boombox!", pName);
SendNearbyMessage(playerid, 15, string2, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetPVarInt(playerid, "PlacedBB", CreateDynamicObject(2226, BBCoord[0], BBCoord[1], BBCoord[2], 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
format(string, sizeof(string), "Boombox Owner: %s\nUse /setboombox to set your boombox\n/pickupboombox to Pick up your boombox", pName);
SetPVarInt(playerid, "BBLabel", _:CreateDynamic3DTextLabel(string, -1, BBCoord[0], BBCoord[1], BBCoord[2]+0.6, 5, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBArea", CreateDynamicSphere(BBCoord[0], BBCoord[1], BBCoord[2], 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
SetPVarInt(playerid, "BBInt", GetPlayerInterior(playerid));
SetPVarInt(playerid, "BBVW", GetPlayerVirtualWorld(playerid));
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
return 1;
}
if (strcmp("/setboombox", cmdtext, true, 10) == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ")))
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
else
{
return SCM(playerid, -1, "You're not near in your BoomBox!");
}
}
else
{
SCM(playerid, -1, " You don't have a boombox placed down!");
}
return 1;
}
if (strcmp("/pickupboombox", cmdtext, true, 10) == 0)
{
if(!GetPVarInt(playerid, "PlacedBB"))
{
SCM(playerid, -1, "You haven't placed a Boombox!");
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ")))
{
PickUpBoombox(playerid);
SCM(playerid, -1, "Boombox picked up successfully.");
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_BOOMBOX)
{
if(!response)
{
SCM(playerid, COLOR_WHITE, " You cancel the Radio Station");
return 1;
}
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX1,DIALOG_STYLE_LIST,"Jazz","Smooth Jazz\nCrooze Jazz","Select","Cancel");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_LIST,"Pop","Power FM\nCharHitz","Select","Cancel");
}
case 2:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX3,DIALOG_STYLE_LIST,"Rap","RadioUP #1\nFlow 103 Rap","Select","Cancel");
}
case 3:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX4,DIALOG_STYLE_LIST,"Hip Hop","Hot 108 Jamz\nThe Beat #1","Select","Cancel");
}
case 4:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX5,DIALOG_STYLE_LIST,"Rock","Radio Paradise\nNoise FM","Select","Cancel");
}
case 5:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX6,DIALOG_STYLE_LIST,"Country","181 Kicking Country\nAbsolute Country Radio","Select","Cancel");
}
case 6:
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX7,DIALOG_STYLE_INPUT, "Boombox Input URL", "Please put a Music URL to play the Music", "Play", "Cancel");
}
case 7:
{
if(GetPVarType(playerid, "BBArea"))
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "* %s has turned off their boombox.", pName);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
StopStream(i);
}
}
DeletePVar(playerid, "BBStation");
}
SCM(playerid, COLOR_WHITE, "You've turn off your boombox");
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX1)//JAZZ
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=146931", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=146931");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX2)//POP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13448", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13448");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX3)//RAP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX4)//HIP HOP
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=105867", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=105867");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX5)//ROCK
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=785339", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=785339");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=19275", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=19275");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX6)//COUNTRY
{
if(!response)
{
ShowPlayerDialog(playerid,DIALOG_BOOMBOX,DIALOG_STYLE_LIST,"Radio List","Jazz\nPop\nRap\nR&B and Urban\nRock\nCountry\nEnter URL\nTurn Off Boombox","Select", "Cancel");
}
if(response)
{
if(listitem == 0)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=71887", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=71887");
}
}
if(listitem == 1)
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=34839", GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=34839");
}
}
}
return 1;
}
if(dialogid == DIALOG_BOOMBOX7)//SET URL
{
if(response == 1)
{
if(isnull(inputtext))
{
SCM(playerid, COLOR_WHITE, "You did not enter anything" );
return 1;
}
if(strlen(inputtext))
{
if(GetPVarType(playerid, "PlacedBB"))
{
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
{
PlayStream(i, inputtext, GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BBStation", inputtext);
}
}
}
else
{
return 1;
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}