Код:
CMD:placeboombox(playerid, params[])
{
if(PlayerInfo[playerid][pBoombox] == 1 || PlayerInfo[playerid][pAdmin] >= 4)
{
if(GetPVarInt(playerid, "IsInArena") >= 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
if(WatchingTV[playerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can not do this while watching TV!");
if(GetPVarInt(playerid, "Injured") == 1 || PlayerInfo[playerid][pHospital] == 1 || IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
if (PlayerInfo[playerid][pVW] == 0 || PlayerInfo[playerid][pInt] == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You can only place boomboxes inside interiors.");
if(GetPVarType(playerid, "pBoomBox")) return SendClientMessageEx(playerid, COLOR_WHITE, "You already have a boombox out, use /destroyboombox.");
foreach(new i: Player)
{
if(GetPVarType(i, "pBoomBox"))
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "pBoomBoxX"), GetPVarFloat(i, "pBoomBoxY"), GetPVarFloat(i, "pBoomBoxZ")))
{
SendClientMessage(playerid, COLOR_WHITE, "You are in range of another boombox, you can't place one here!");
return 1;
}
}
}
new string[128];
format(string, sizeof(string), "%s has placed a boombox!", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
ApplyAnimation(playerid,"BOMBER","BOM_Plant_Crouch_In", 4.0, 0, 0, 0, 0, 0, 1);
x += (2 * floatsin(-a, degrees));
y += (2 * floatcos(-a, degrees));
z -= 1.0;
SetPVarInt(playerid, "pBoomBox", CreateDynamicObject(2103, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarFloat(playerid, "pBoomBoxX", x); SetPVarFloat(playerid, "pBoomBoxY", y); SetPVarFloat(playerid, "pBoomBoxZ", z);
format(string, sizeof(string), "%s's boombox\n{FF0000}/setboombox {FFFF00}or\n{FF0000}/destroyboombox", GetPlayerNameEx(playerid));
SetPVarInt(playerid, "pBoomBoxLabel", _:CreateDynamic3DTextLabel(string, COLOR_YELLOW, x, y, z+0.6, 5.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarInt(playerid, "pBoomBoxArea", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
SetPVarInt(playerid, "pBoomBoxInt", GetPlayerInterior(playerid));
SetPVarInt(playerid, "pBoomBoxVW", GetPlayerVirtualWorld(playerid));
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have a boom box! Buy from one shop.ng-gaming.net");
}
return 1;
}
CMD:destroyboombox(playerid, params[])
{
if(GetPVarType(playerid, "pBoomBox"))
{
DestroyDynamicObject(GetPVarInt(playerid, "pBoomBox"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "pBoomBoxLabel"));
DeletePVar(playerid, "pBoomBox"); DeletePVar(playerid, "pBoomBoxStation"); DeletePVar(playerid, "pBoomBoxLabel");
DeletePVar(playerid, "pBoomBoxX"); DeletePVar(playerid, "pBoomBoxY"); DeletePVar(playerid, "pBoomBoxZ");
if(GetPVarType(playerid, "pBoomBoxArea"))
{
new string[128];
format(string, sizeof(string), "* %s has destroyed the boombox.", GetPlayerNameEx(playerid));
foreach(new i: Player)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
{
StopAudioStreamForPlayerEx(i);
SendClientMessage(i, COLOR_PURPLE, string);
}
}
DeletePVar(playerid, "pBoomBoxArea");
}
SendClientMessage(playerid, COLOR_WHITE, "You've destroyed your boombox!");
}
else
{
foreach(new i: Player)
{
if(GetPVarType(i, "pBoomBox"))
{
if(GetPVarInt(i, "pBoomBoxVW") == GetPlayerVirtualWorld(playerid) && GetPVarInt(i, "pBoomBoxInt") == GetPlayerInterior(playerid) && IsPlayerInRangeOfPoint(playerid, 5.0, GetPVarFloat(i, "pBoomBoxX"), GetPVarFloat(i, "pBoomBoxY"), GetPVarFloat(i, "pBoomBoxZ")))
{
DestroyDynamicObject(GetPVarInt(i, "pBoomBox"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(i, "pBoomBoxLabel"));
DeletePVar(i, "pBoomBox");
DeletePVar(i, "pBoomBoxStation");
DeletePVar(i, "pBoomBoxLabel");
DeletePVar(i, "pBoomBoxX");
DeletePVar(i, "pBoomBoxY");
DeletePVar(i, "pBoomBoxZ");
DeletePVar(i, "pBoomBoxInt");
DeletePVar(i, "pBoomBoxVW");
new string[128];
if(GetPVarType(i, "pBoomBoxArea"))
{
format(string, sizeof(string), "* %s has destroyed the boombox.", GetPlayerNameEx(playerid));
foreach(new pi: Player)
{
if(IsPlayerInDynamicArea(pi, GetPVarInt(i, "pBoomBoxArea")))
{
StopAudioStreamForPlayerEx(pi);
SendClientMessage(pi, COLOR_PURPLE, string);
}
}
DeletePVar(i, "pBoomBoxArea");
}
format(string, sizeof(string), "%s has destroyed your boombox!", GetPlayerNameEx(playerid));
SendClientMessage(i, COLOR_WHITE, string);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_WHITE, "You don't have a boombox or you are not near one to destroy.");
}
return 1;
}
CMD:setboombox(playerid, params[])
{
if(GetPVarType(playerid, "pBoomBox"))
{
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select", "Close");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You don't have a boombox out!");
}
return 1;
}
CMD:househelp(playerid, params[])
{
SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessageEx(playerid, COLOR_WHITE,"*** HOUSE HELP *** - type a command for more infomation.");
SendClientMessageEx(playerid, COLOR_GRAD3,"*** HOUSE *** /houselock /setrentable /setrent /evict /evictall /sellhouse /sellmyhouse /ringbell");
SendClientMessageEx(playerid, COLOR_GRAD3,"*** HOUSE *** /hwithdraw /hdeposit /hbalance /getgun /storegun /houseinvite");
SendClientMessageEx(playerid, COLOR_GRAD3,"*** HOUSE *** /movegate /housegatepw");
return 1;
}
CMD:carhelp(playerid, params[])
{
SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessageEx(playerid, COLOR_WHITE,"*** CAR OWNERSHIP HELP *** - type a command for more infomation.");
SendClientMessageEx(playerid, COLOR_GRAD3,"*** CAR OWNERSHIP *** /buylock /pvlock /park /unmodcar /deletecar /sellmycar /trackcar");
SendClientMessageEx(playerid, COLOR_GRAD3,"*** CAR OWNERSHIP *** /dmvmenu /givekeys /carkeys /trunkput /trunktake /car /refuel /speedo /gps /turnoff");
return 1;
}
CMD:reportcmds(playerid, params[])
{
SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
SendClientMessageEx(playerid, COLOR_WHITE,"* /ar : Accepts the report");
SendClientMessageEx(playerid, COLOR_GRAD3,"* /tr : Trashes the report");
SendClientMessageEx(playerid, COLOR_GRAD3,"* /sta : Transfers the report to an advisor");
SendClientMessageEx(playerid, COLOR_GRAD3,"* /post : Says the report should be handled on the forums");
SendClientMessageEx(playerid, COLOR_GRAD3,"* /stn : Says the report should be asked in /n");
SendClientMessageEx(playerid, COLOR_GRAD3,"* /st : Transfers the report to a SHOP TECH");
return 1;
}