[Help] Please help on my boombox system!
#1

Please someone help me on my boombox!
I got 4 errors, i don't know how can i fix it! o.o

Here's the screenshot.
http://prntscr.com/e49ua

This is the code
http://prntscr.com/e4a02

Help!
Reply
#2

Код:
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;
}
Reply
#3

NGRP script -_-
Reply
#4

Just help me dudes. -.-
Reply
#5

add new <foreach> at the top of your script.
Reply
#6

Not works. o.o
Reply
#7

Here's my new error O.o

Код:
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(3724) : warning 235: public function lacks forward declaration (symbol "Audio_OnSetPack")
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34981) : warning 217: loose indentation
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34985) : error 017: undefined symbol "StopAudioStreamForPlayerEx"
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34989) : warning 217: loose indentation
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34995) : error 029: invalid expression, assumed zero
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34995) : warning 215: expression has no effect
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34995) : error 017: undefined symbol "i"
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34995) : warning 215: expression has no effect
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34995) : error 017: undefined symbol "i"
C:\Users\aNdRe\Downloads\EG-RP - Copy\0.3e USRP 0.3e\gamemodes\EG-RP.pwn(34995) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#8

And here is it. What should i change here?

Код:
	                StopAudioStreamForPlayerEx(i);
	                SendClientMessage(i, COLOR_PURPLE, string);
				}
			}
	        DeletePVar(playerid, "pBoomBoxArea");
		}
		SendClientMessage(playerid, COLOR_WHITE, "You've destroyed your boombox!");
	}
	else
	{
	    (new i; i<MAX_PLAYERS; i++)
	    {
	        if(GetPVarType(i, "pBoomBox"))
Reply
#9

Please help me immedetley. XD
Reply
#10

cant help, you cant +rep xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)