[Ajuda] Trocar comando
#7

Hum, Acho que й assim:

PHP код:
CMD:boombox(playeridparams[])
{
    new 
string[256];
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1"[ ERRO ] Vocк nгo estб conectado no servidor!");
    if(!
GetPVarType(playerid"BoomboxObject"))
    {
        if(
sscanf(params"s[256]"params)) return SendClientMessage(playerid, -1"USAGE: /boombox [music url]");
        foreach(
Playeri)
        {
            if(
GetPVarType(i"BoomboxObject"))
            {
                if(
IsPlayerInRangeOfPoint(playerid30.0GetPVarFloat(i"bposX"), GetPVarFloat(i"bposY"), GetPVarFloat(i"bposZ"))) return SendClientMessage(playeridCOLOR_GREY" There is another boombox nearby, place yours somewhere else.");
                new 
FloatxFloatyFloatzFloata;
                
GetPlayerPos(playeridxyz);
                
GetPlayerFacingAngle(playerida);
                
SetPVarInt(playerid"BoomboxObject"CreateDynamicObject(2103xyz0.00.00.0, .worldid GetPlayerVirtualWorld(playerid), .interiorid GetPlayerInterior(playerid)));
                
SetPVarFloat(playerid"bposX"x);
                
SetPVarFloat(playerid"bposY"y);
                
SetPVarFloat(playerid"bposZ"z);
                
SetPVarInt(playerid"bboxareaid"CreateDynamicSphere(xyz30.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
                
format(stringsizeof(string), " You have placed your boombox at your location.");
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                foreach(
Playeri)
                {
                    if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid"))) PlayAudioStreamForPlayer(iparamsGetPVarFloat(playerid"bposX"), GetPVarFloat(playerid"bposY"), GetPVarFloat(playerid"bposZ"), 30.01);
                }
                
SetPVarString(playerid"BoomboxURL"params);
            }
            else
            {
                
DestroyDynamicObject(GetPVarInt(playerid"BoomboxObject"));
                
DeletePVar(playerid"BoomboxObject");
                
DeletePVar(playerid"BoomboxURL");
                
DeletePVar(playerid"bposX");
                
DeletePVar(playerid"bposY");
                
DeletePVar(playerid"bposZ");
                if(
GetPVarType(playerid"bboxareaid"))
                {
                    foreach(
Playeri)
                    {
                        if(
IsPlayerInDynamicArea(iGetPVarInt(playerid"bboxareaid")))
                        {
                            
StopAudioStreamForPlayer(i);
                            
SendClientMessage(iCOLOR_GREY" The boombox creator has removed his boombox.");
                        }
                    }
                    
DeletePVar(playerid"bboxareaid");
                }
                
SendClientMessage(playeridCOLOR_LIGHTBLUE" You have removed your boombox.");
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Trocar comando - by SukMathcuck - 11.12.2014, 18:03
Re: Trocar comando - by MultiKill - 11.12.2014, 18:08
Re: Trocar comando - by SukMathcuck - 11.12.2014, 18:09
Re: Trocar comando - by MultiKill - 11.12.2014, 18:27
Re: Trocar comando - by [BOPE]Seu._.Madruga - 11.12.2014, 18:37
Re: Trocar comando - by SukMathcuck - 11.12.2014, 18:42
Re: Trocar comando - by [BOPE]Seu._.Madruga - 11.12.2014, 18:53

Forum Jump:


Users browsing this thread: 1 Guest(s)