Problem with boombox, setstation
#7

Use this

PHP код:
CMD:setstation(playeridparams[])
{
    if(
GetPVarType(playerid"pBoomBox"))
    {
        if(
GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return SendClientMessage(playeridCOLOR_GREY" You must be crouched to turnon your boombox.");
        if(!
IsPlayerInRangeOfPoint(playerid3.0GetPVarFloat(playerid"pBoomBoxX"), GetPVarFloat(playerid"pBoomBoxY"), GetPVarFloat(playerid"pBoomBoxZ"))) return SendClientMessageEx(playeridCOLOR_WHITE"You're not near in your BoomBox");
        {
           
ShowPlayerDialogEx(playeridDIALOG_BOOMBOX_STARTDIALOG_STYLE_LIST"Boombox""Search by name\nFind by genre\nPlace Music URL""Select""Cancel");
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1" You don't have a boombox place on the floor");
    }
    return 
1;

PHP код:
CMD:pickupboombox(playeridparams[])
{
    if(
GetPVarType(playerid"pBoomBox"))
    {
        if(
GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return SendClientMessage(playeridCOLOR_GREY" You must be crouched to pick a the boombox.");
        if(!
IsPlayerInRangeOfPoint(playerid3.0GetPVarFloat(playerid"pBoomBoxX"), GetPVarFloat(playerid"pBoomBoxY"), GetPVarFloat(playerid"pBoomBoxZ"))) return SendClientMessageEx(playeridCOLOR_WHITE"You're not near in your BoomBox");
        
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(stringsizeof(string), "* %s has pickup their boombox."GetPlayerNameEx(playerid));
            
ProxDetector(30.0playeridstringCOLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            foreach(
Playeri)
            {
                if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"pBoomBoxArea")))
                {
                    
StopAudioStreamForPlayerEx(i);
                    
SendClientMessage(iCOLOR_PURPLEstring);
                }
            }
            
DeletePVar(playerid"pBoomBoxArea");
        }
        
SendClientMessage(playeridCOLOR_WHITE"You've pickup your boombox!");
    }
    else
    {
        foreach(
Playeri)
        {
            if(
GetPVarType(i"pBoomBox"))
            {
                if(
GetPVarInt(i"pBoomBoxVW") == GetPlayerVirtualWorld(playerid) && GetPVarInt(i"pBoomBoxInt") == GetPlayerInterior(playerid) && IsPlayerInRangeOfPoint(playerid5.0GetPVarFloat(i"pBoomBoxX"), GetPVarFloat(i"pBoomBoxY"), GetPVarFloat(i"pBoomBoxZ")))
                {
                    if(
GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return SendClientMessage(playeridCOLOR_GREY" You must be crouched to pick a the boombox.");
                    if(!
IsPlayerInRangeOfPoint(playerid3.0GetPVarFloat(playerid"pBoomBoxX"), GetPVarFloat(playerid"pBoomBoxY"), GetPVarFloat(playerid"pBoomBoxZ"))) return SendClientMessageEx(playeridCOLOR_WHITE"You're not near in your BoomBox");
                    
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(stringsizeof(string), "* %s has pickup their boombox."GetPlayerNameEx(playerid));
                        for(new 
x=0x<MAX_PLAYERSx++)
                        {
                            if(
IsPlayerInDynamicArea(xGetPVarInt(x"pBoomBoxArea")))
                            {
                                
StopAudioStreamForPlayerEx(x);
                                
SendClientMessage(xCOLOR_PURPLEstring);
                            }
                        }
                        
DeletePVar(i"pBoomBoxArea");
                    }
                    
format(stringsizeof(string), "%s has pickup their boombox!"GetPlayerNameEx(playerid));
                    
SendClientMessage(iCOLOR_WHITEstring);
                    return 
1;
                }
            }
        }
        
SendClientMessage(playeridCOLOR_WHITE"You don't have a boombox or you are not near one to be pickup");
    }
    return 
1;

PHP код:
CMD:placeboombox(playeridparams[])
{
    if(
PlayerInfo[playerid][pLevel] > 1)
    {
        if(
GetPVarInt(playerid"IsInArena") >= 0) return SendClientMessageEx(playeridCOLOR_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") == || PlayerInfo[playerid][pHospital] == || IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playeridCOLOR_WHITE"You can't do this right now.");
        if(
GetPVarType(playerid"pBoomBox")) return SendClientMessageEx(playeridCOLOR_WHITE"You already have a boombox out, use /pickupboombox.");
        foreach(
Playeri)
        {
            if(
GetPVarType(i"pBoomBox"))
            {
                if(
IsPlayerInRangeOfPoint(playerid30.0GetPVarFloat(i"pBoomBoxX"), GetPVarFloat(i"pBoomBoxY"), GetPVarFloat(i"pBoomBoxZ")))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"You are in range of another boombox, you can't place one here!");
                    return 
1;
                }
            }
        }
        new 
string[128];
        
format(stringsizeof(string), "%s has placed a boombox! on the floor"GetPlayerNameEx(playerid));
        
ProxDetector(30.0playeridstringCOLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
        new 
Float:xFloat:yFloat:zFloat:a;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playerida);
        
ApplyAnimation(playerid,"BOMBER","BOM_Plant_Crouch_In"4.0000001);
        
+= (floatsin(-adegrees));
        
+= (floatcos(-adegrees));
        
-= 1.0;
        
SetPVarInt(playerid"pBoomBox"CreateDynamicObject(2226xyz0.00.00.0, .worldid GetPlayerVirtualWorld(playerid), .interiorid GetPlayerInterior(playerid)));
        
SetPVarFloat(playerid"pBoomBoxX"x); SetPVarFloat(playerid"pBoomBoxY"y); SetPVarFloat(playerid"pBoomBoxZ"z);
        
format(stringsizeof(string), "%s's BoomBox\n{FF0000}/turnon {FFFF00}or\n{FF0000}/pickupboombox"GetPlayerNameEx(playerid));
        
SetPVarInt(playerid"pBoomBoxLabel"_:CreateDynamic3DTextLabel(stringCOLOR_YELLOWxyz+0.65.0, .worldid GetPlayerVirtualWorld(playerid), .interiorid GetPlayerInterior(playerid)));
        
SetPVarInt(playerid"pBoomBoxArea"CreateDynamicSphere(xyz30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
        
SetPVarInt(playerid"pBoomBoxInt"GetPlayerInterior(playerid));
        
SetPVarInt(playerid"pBoomBoxVW"GetPlayerVirtualWorld(playerid));
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1"You are not Level 1+");
    }
    return 
1;

REP +1 Me if I helped you.
Reply


Messages In This Thread
Problem with boombox, setstation - by Bumie - 09.07.2015, 09:57
Re: Problem with boombox, setstation - by Bumie - 14.07.2015, 15:41
Re: Problem with boombox, setstation - by Virtual1ty - 14.07.2015, 17:41
Re: Problem with boombox, setstation - by Bumie - 15.07.2015, 05:37
Re: Problem with boombox, setstation - by Virtual1ty - 15.07.2015, 12:06
Re: Problem with boombox, setstation - by Bumie - 16.07.2015, 06:56
Re: Problem with boombox, setstation - by XBrianX - 16.07.2015, 12:25

Forum Jump:


Users browsing this thread: 1 Guest(s)