Problem with boombox, setstation
#1

When I use this command but the item doesn't play any song. I don't know how to configuration it, some one help me please
PHP код:
else if(dialogid == SETSTATION)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(!
GetPVarType(playerid"pHTTPWait"))
                {
                    
SetPVarInt(playerid"pHTTPWait"1);
                    
format(stringsizeof(string), "%s/radio/radio.php?listgenres=1"SAMP_WEB);
                    
HTTP(playeridHTTP_GETstring"""GenreHTTP");
                }
                else
                {
                    
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
                }
            }
            else if(
listitem == 1)
            {
                if(!
GetPVarType(playerid"pHTTPWait"))
                {
                    
SetPVarInt(playerid"pHTTPWait"1);
                    
format(stringsizeof(string), "%s/top100/Nhac-Tre/IWZ9Z088.html"SAMP_WEB);
                    
HTTP(playeridHTTP_GETstring"""Top50HTTP");
                }
                else
                {
                    
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
                }
            }
            else if(
listitem == 2)
            {
                
ShowPlayerDialog(playerid,STATIONSEARCH,DIALOG_STYLE_INPUT,"Station Search","Input a search criteria:","Search","Quay lai");
            }
            else if(
listitem == 3)
            {
                if(
IsPlayerInAnyVehicle(playerid))
                {
                     foreach(new 
iPlayer)
                    {
                        if(
GetPlayerVehicleID(i) != && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                            
//PlayAudioStreamForPlayerEx(i, "http://shoutcast.ng-gaming.net:8000/listen.pls?sid=1");
                        
}
                      }
                      
//format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://shoutcast.ng-gaming.net:8000/listen.pls?sid=1");
                      
format(stringsizeof(string), "* %s changes the radio station."GetPlayerNameEx(playerid), string);
                    
ProxDetector(10.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(
GetPVarType(playerid"pBoomBox"))
                {
                    foreach(new 
iPlayer)
                    {
                        if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"pBoomBoxArea")))
                        {
                            
//PlayAudioStreamForPlayerEx(i, "http://shoutcast.ng-gaming.net:8000/listen.pls?sid=1", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                          
}
                      }
                      
//SetPVarString(playerid, "pBoomBoxStation", "http://shoutcast.ng-gaming.net:8000/listen.pls?sid=1");
                
}
                else
                {
                   
// PlayAudioStreamForPlayerEx(playerid, "http://shoutcast.ng-gaming.net:8000/listen.pls?sid=1");
                   // SetPVarInt(playerid, "MusicIRadio", 1);
                
}
            }
            else if(
listitem == 4)
            {
                if(
IsPlayerInAnyVehicle(playerid))
                {
                     foreach(new 
iPlayer)
                     {
                         if(
GetPlayerVehicleID(i) != && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                            
//PlayAudioStreamForPlayerEx(i, "http://nick.ng-gaming.net:8000/listen.pls");
                        
}
                    }
                  
//    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://nick.ng-gaming.net:8000/listen.pls");
                      
format(stringsizeof(string), "* %s changes the radio station."GetPlayerNameEx(playerid), string);
                    
ProxDetector(10.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(
GetPVarType(playerid"pBoomBox"))
                {
                    foreach(new 
iPlayer)
                    {
                        if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"pBoomBoxArea")))
                        {
                        
//    PlayAudioStreamForPlayerEx(i, "http://nick.ng-gaming.net:8000/listen.pls", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                          
}
                      }
                  
//    SetPVarString(playerid, "pBoomBoxStation", "http://nick.ng-gaming.net:8000/listen.pls");
                
}
                else
                {
                
//    PlayAudioStreamForPlayerEx(playerid, "http://nick.ng-gaming.net:8000/listen.pls");
                 //   SetPVarInt(playerid, "MusicIRadio", 1);
                
}
            }
            else if(
listitem == 5)
            {
                if(
GetPVarType(playerid"pBoomBox"))
                {
                    
SendClientMessageEx(playeridCOLOR_GRAD1"Sorry, this feature is for the MP3 Player or vehicles only.");
                }
                if(
IsPlayerInAnyVehicle(playerid))
                {
                    
SendClientMessageEx(playeridCOLOR_GRAD1"You must be using your MP3 to use this feature.");
                }
                else
                {
                    
ShowPlayerDialog(playeridCUSTOM_URLCHOICEDIALOG_STYLE_INPUT"Custom URL""Please insert a valid audio url stream.""Dong y""Quay lai");
                }
            }
            else if(
listitem == 6)
            {
                if(!
IsPlayerInAnyVehicle(playerid))
                {
                    if(
GetPVarType(playerid"pBoomBox"))
                    {
                        
SendClientMessage(playeridCOLOR_WHITE"You have turned off the boom box.");
                        foreach(new 
iPlayer)
                        { if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"pBoomBoxArea"))) StopAudioStreamForPlayerEx(i); }
                          
DeletePVar(playerid"pBoomBoxStation");
                    }
                    else
                    {
                        
StopAudioStreamForPlayerEx(playerid);
                    }
                }
                  else
                  {
                      
format(stringsizeof(string), "* %s turns off the radio."GetPlayerNameEx(playerid), string);
                    
ProxDetector(10.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    foreach(new 
iPlayer)
                    {
                        if(
GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                            
StopAudioStreamForPlayerEx(i);
                          }
                    }
                       
stationidv[GetPlayerVehicleID(playerid)][0] = 0;
                }
            }
        }
    } 
Reply
#2

Someone help me this problem please
Reply
#3

The URL (second parameter) to PlayAudioStreamForPlayer must be a valid stream, playlist or an mp3 file. For the "boombox" part we can't possibly know how you handle reproduction because you didn't show us dialog response code for dialog "CUSTOM_URLCHOICE".
As for the "set station" HTTP part, we can't know how you handle reproduction because you didn't show us "GenreHTTP" and "Top50HTTP" callbacks. Also, most of the "PlayAudioStreamForPlayer" code is commented out, so how is it supposed to work then?
Reply
#4

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
The URL (second parameter) to PlayAudioStreamForPlayer must be a valid stream, playlist or an mp3 file. For the "boombox" part we can't possibly know how you handle reproduction because you didn't show us dialog response code for dialog "CUSTOM_URLCHOICE".
As for the "set station" HTTP part, we can't know how you handle reproduction because you didn't show us "GenreHTTP" and "Top50HTTP" callbacks. Also, most of the "PlayAudioStreamForPlayer" code is commented out, so how is it supposed to work then?
Sorry, I'm not good at Code and I'm trying to do it, this is code what you need.
PHP код:
else if(dialogid == CUSTOM_URLCHOICE)
    {
        if(
response)
        {
            if(
isnull(inputtext) || IsNumeric(inputtext)) return SendClientMessageEx(playeridCOLOR_GRAD1"You have not entered a valid URL.");
            
PlayAudioStreamForPlayerEx(playeridinputtext);
            
SetPVarInt(playerid"MusicIRadio"1);
            
format(stringsizeof(string), "You are now playing %s."inputtext);
            
SendClientMessageEx(playeridCOLOR_GREENstring);
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
    }
    else if(
dialogid == GENRES)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d"SAMP_WEB, (listitem+1));
                
SetPVarInt(playerid"pSelectGenre", (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationListHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
            
DeletePVar(playerid"pSelectGenre");
        }
    }
    else if(
dialogid == STATIONLIST)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d&station=%d"SAMP_WEBGetPVarInt(playerid"pSelectGenre"), (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
SetPVarInt(playerid"pSelectStation", (listitem+1));
                
HTTP(playeridHTTP_GETstring"""StationInfoHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
SetPVarInt(playerid"pHTTPWait"1);
                
format(stringsizeof(string), "%s/radio/radio.php?listgenres=1"SAMP_WEB);
                
HTTP(playeridHTTP_GETstring"""GenreHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == TOP50LIST)
    {
        if(!
response)
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?top50=1&station=%d"SAMP_WEB, (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
SetPVarInt(playerid"pSelectStation", (listitem+1));
                
HTTP(playeridHTTP_GETstring"""Top50InfoHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == STATIONLISTEN)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d&station=%d&listen=1"SAMP_WEBGetPVarInt(playerid"pSelectGenre"), GetPVarInt(playerid"pSelectStation"));
                
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationSelectHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?genre=%d"SAMP_WEBGetPVarInt(playerid"pSelectGenre"));
                   
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationListHTTP");
                
DeletePVar(playerid"pSelectStation");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == TOP50LISTEN)
    {
        if(!
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
DeletePVar(playerid"pSelectStation");
                
SetPVarInt(playerid"pHTTPWait"1);
                
format(stringsizeof(string), "%s/radio/radio.php?top50=1"SAMP_WEB);
                
HTTP(playeridHTTP_GETstring"""Top50HTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
format(stringsizeof(string), "%s/radio/radio.php?top50=1&station=%d&listen=1"SAMP_WEBGetPVarInt(playerid"pSelectStation"));
                
SetPVarInt(playerid"pHTTPWait"1);
                
HTTP(playeridHTTP_GETstring"""StationSelectHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    }
    else if(
dialogid == STATIONSEARCH)
    {
        if(
response)
        {
            if(
strlen(inputtext) < || strlen(inputtext) > 64)
            {
                
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
            }
            else
            {
                if(!
GetPVarType(playerid"pHTTPWait"))
                {
                    
format(stringsizeof(string), "%s/tim-kiem/bai-hat.html?q=%s"SAMP_WEBinputtext);
                    
SetPVarString(playerid"pSearchStation"inputtext);
                    
SetPVarInt(playerid"pHTTPWait"1);
                    
ShowNoticeGUIFrame(playerid6);
                    
HTTP(playeridHTTP_GETstring"""StationSearchHTTP");
                }
                else
                {
                    
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
                }
            }
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
    }
    else if(
dialogid == STATIONSEARCHLIST)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
GetPVarString(playerid"pSearchStation"stringsizeof(string));
                
format(stringsizeof(string), "%s/tim-kiem/bai-hat.html?q=%s&stattion=%d"SAMP_WEBstring, (listitem+1));
                
SetPVarInt(playerid"pHTTPWait"1);
                
ShowNoticeGUIFrame(playerid6);
                
SetPVarInt(playerid"pSelectStation", (listitem+1));
                
HTTP(playeridHTTP_GETstring"""StationSearchInfoHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            
ShowPlayerDialog(playerid,SETSTATION,DIALOG_STYLE_LIST,"Radio Menu","Genres\nTop 50 Stations\nSearch\nK-LSR\nNick's Radio\nTurn radio off","Select""Close");
        }
    }
    else if(
dialogid == STATIONSEARCHLISTEN)
    {
        if(
response)
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                   
GetPVarString(playerid"pSearchStation"stringsizeof(string));
                
format(stringsizeof(string), "%s/radio/radio.php?search=%s&station=%d&listen=1"SAMP_WEBstringGetPVarInt(playerid"pSelectStation"));
                
SetPVarInt(playerid"pHTTPWait"1);
                
ShowNoticeGUIFrame(playerid6);
                
HTTP(playeridHTTP_GETstring"""StationSelectHTTP");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
        else
        {
            if(!
GetPVarType(playerid"pHTTPWait"))
            {
                
GetPVarString(playerid"pSearchStation"stringsizeof(string));
                
format(stringsizeof(string), "%s/radio/radio.php?search=%s"SAMP_WEBstring);
                
ShowNoticeGUIFrame(playerid6);
                
HTTP(playeridHTTP_GETstring"""StationSearchHTTP");
                
DeletePVar(playerid"pSelectStation");
            }
            else
            {
                
SendClientMessage(playerid0xFFFFFFAA"HTTP Thread is busy");
            }
        }
    } 
Reply
#5

Without full code we can't help you with any of this, I'm sorry. There are too many missing HTTP callbacks. I believe you are trying to link a Vietnamese music website to your "radio player". Check if the site has changed in the meantime, if it has, then your "url hacks": "/radio/radio.php?listgenres=1", etc. won't work.

Also, like I said, there is no "PlayAudioStreamForPlayer" to play the audio stream to the player so it will never work, unless you have put it in one of your "HTTP" callbacks which you haven't shown us.
Reply
#6

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
Without full code we can't help you with any of this, I'm sorry. There are too many missing HTTP callbacks. I believe you are trying to link a Vietnamese music website to your "radio player". Check if the site has changed in the meantime, if it has, then your "url hacks": "/radio/radio.php?listgenres=1", etc. won't work.

Also, like I said, there is no "PlayAudioStreamForPlayer" to play the audio stream to the player so it will never work, unless you have put it in one of your "HTTP" callbacks which you haven't shown us.
I Use NGG mode, but I'm trying to show all code I think it contact with this cmd, I don't hide anything. I'm crazy about this
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)