[Ajuda] Converter BoomBox
#6

pawn Код:
if(!strcmp(cmdtext,"boombox",true))
{
    new string[128];
    if(!Boombox[playerid])
    {
        new idx;
        if(sscanf(params, "s[256]", strtok(cmdtext,idx))) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [music url]");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    if(Boombox[i])
                    {
                        if(IsPlayerInRangeOfPoint(playerid, 30, bpos[i][0], bpos[i][1], bpos[i][2]))
                        {
                            SendClientMessage(playerid, COLOR_GREY, " There is another boombox nearby, place yours somewhere else.");
                            return 1;
                        }
                    }
            }
        }
        Boombox[playerid] = 1;
        format(string, sizeof(string), " You have placed your boombox at your location.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        GetPlayerPos(playerid, bpos[playerid][0], bpos[playerid][1], bpos[playerid][2]); bpos[playerid][2] = bpos[playerid][2] - 1;
        GetPlayerFacingAngle(playerid, bpos[playerid][3]); bpos[playerid][3] = bpos[playerid][3] +180;
        BoomboxObject[playerid] = CreateDynamicObject(2103, bpos[playerid][0], bpos[playerid][1], bpos[playerid][2], 0, 0, bpos[playerid][3]);
        format(BoomboxURL[playerid], 256, "%s", params);
    }
    else
    {
        Boombox[playerid] = 0;
        format(string, sizeof(string), " You have removed your boombox.");
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        DestroyDynamicObject(BoomboxObject[playerid]);
        format(BoomboxURL[playerid], 256, "");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(BoomboxPlayer[i] == playerid)
                {
                    BoomboxStream[i] = 0;
                    BoomboxPlayer[i] = -1;
                    StopAudioStreamForPlayer(i);
                    SendClientMessage(i, COLOR_GREY, " The boombox creator has removed his boombox.");
                }
            }
        }
    }
    return 1;
}
use este exemplo para fazer o outro.
Reply


Messages In This Thread
Converter BoomBox - by Felipe_Freeze - 27.07.2012, 20:11
Re: Converter BoomBox - by Abravanel - 27.07.2012, 20:16
Re: Converter BoomBox - by Felipe_Freeze - 27.07.2012, 20:29
Re: Converter BoomBox - by leonardo1434 - 27.07.2012, 20:50
Re: Converter BoomBox - by Pedro_BML - 27.07.2012, 23:25
Respuesta: Converter BoomBox - by [JD]BlackFire - 27.07.2012, 23:30

Forum Jump:


Users browsing this thread: 3 Guest(s)