Boombox Help
#1

The 3d label sometimes looks like this it has that bracket {
Do not complain about the sobiet also btw


CODE
Код:
CMD:placeboombox(playerid, params[])
{
    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(GetPVarType(playerid, "pDynamicBB")) return SendClientMessageEx(playerid, COLOR_WHITE, "You already have a boombox out, use /pickupboombox.");

    foreach(Player, i)
    {
        if(GetPVarType(i, "pDynamicBB"))
        {
            if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "pDynamicBBX"), GetPVarFloat(i, "pDynamicBBY"), GetPVarFloat(i, "pDynamicBBZ")))
            {
                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_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

    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, "pDynamicBB", CreateDynamicObject(2226, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
    SetPVarFloat(playerid, "pDynamicBBX", x); SetPVarFloat(playerid, "pDynamicBBY", y); SetPVarFloat(playerid, "pDynamicBBZ", z);
    format(string, sizeof(string), "{00FF00}Boombox Owner:{FFFFFF}%s\n{FF0000}/setboombox{FFFFFF} to set your boombox \n{FFFF00}or\n{FF0000}/pickupboombox{FFFFFF}", GetPlayerNameEx(playerid));
    SetPVarInt(playerid, "pDynamicBBLabel", _:CreateDynamic3DTextLabel(string, COLOR_WHITE, x, y, z+0.6, 5.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
    SetPVarInt(playerid, "pDynamicBBArea", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
    SetPVarInt(playerid, "pDynamicBBInt", GetPlayerInterior(playerid));
    SetPVarInt(playerid, "pDynamicBBVW", GetPlayerVirtualWorld(playerid));
    return 1;
}

Another problem im having is the Proxdetector sayin the message twice
Screen:

it shows Have turned off their boombox - twice when it suppose to be once
CODE
Код:
case 6:
            {
                if(GetPVarType(playerid, "pDynamicBBArea"))
                {
                    new string2[128];
                    format(string2, sizeof(string2), "* %s turned off their boombox.", GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    DeletePVar(playerid, "pDynamicBBStation");
                    foreach(Player, i)
                    {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pDynamicBBArea")))
                        {
                            StopAudioEx(i);
                            SendClientMessage(i, COLOR_PURPLE, string2);
                        }
                    }
                }
                SendClientMessage(playerid, COLOR_WHITE, "You've turn off your boombox");
            }
        }
        return 1;
    }
So somebody please give me a fixed code
Reply


Messages In This Thread
Boombox Help - by San1 - 11.11.2012, 08:07
Re: Boombox Help - by Yamakei - 11.11.2012, 08:11
Re: Boombox Help - by JaKe Elite - 11.11.2012, 08:12
Re: Boombox Help - by San1 - 11.11.2012, 08:15

Forum Jump:


Users browsing this thread: 1 Guest(s)