[Ajuda] Trocar comando
#3

Eu quero mudar o comando para o outro modo, mais nгo sei como..

pawn Код:
if (strcmp(cmd, "/boombox", true) == 0)
    {
        if (IsPlayerConnected(playerid))
        {
            new string[128];
            if (!GetPVarType(playerid, "BoomboxObject"))
            {
                if (sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [music url]");
                foreach(Player, i)
                {
                    if (GetPVarType(i, "BoomboxObject"))
                    {
                        if (IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "bposX"), GetPVarFloat(i, "bposY"), GetPVarFloat(i, "bposZ")))
                        {
                            SendClientMessage(playerid, COLOR_GREY, " There is another boombox nearby, place yours somewhere else.");
                            return 1;
                        }
                    }
                }

                new Float: x,
                Float: y,
                Float: z,
                Float: a;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, a);
                SetPVarInt(playerid, "BoomboxObject", CreateDynamicObject(2103, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
                SetPVarFloat(playerid, "bposX", x);
                SetPVarFloat(playerid, "bposY", y);
                SetPVarFloat(playerid, "bposZ", z);
                SetPVarInt(playerid, "bboxareaid", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
                format(string, sizeof(string), " You have placed your boombox at your location.");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                foreach(Player, i)
                {
                    if (IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
                    {
                        PlayAudioStreamForPlayer(i, params, GetPVarFloat(playerid, "bposX"), GetPVarFloat(playerid, "bposY"), GetPVarFloat(playerid, "bposZ"), 30.0, 1);
                    }
                }
                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(Player, i)
                    {
                        if (IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
                        {
                            StopAudioStreamForPlayer(i);
                            SendClientMessage(i, COLOR_GREY, " The boombox creator has removed his boombox.");
                        }
                    }
                    DeletePVar(playerid, "bboxareaid");
                }
                SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have removed your boombox.");
            }
        }
        return 1;
    }
assim?
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)