SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 17/02/2017, 06:45 PM   #1
LuanGamer
Big Clucker
 
Join Date: Oct 2016
Posts: 76
Reputation: 0
Default Comando destruir radio

Boa tarde, estou tentando desenvolver um comando para destruir os radios bugados, só que esse comando que fiz com base em outro só destrói o meu radio, eu quero destruir os radios próximos para caso alguém bugar dê para destrui-lo sem GMX.
PHP Code:
CMD:destruirradio(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] > 1337 && isPertoSound(playerid))
    {
        for(new 
x!= MAX_SOUNDSx++)
        {

        if(
SomInfo[x][somCreated] && SomInfo[x][somID] == playerid)
        {

            
destroySound(x);
        }
        }
    }

Caso precise o código de criação:
Code:
createSound(playerid, urlSound[]){

	static
		Float:Pos[4],
		string[78]
	;

	GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	GetPlayerFacingAngle(playerid, Pos[3]);

	for(new x; x != MAX_SOUNDS; x++){

	    if(!SomInfo[x][somCreated]){

	        SomInfo[x][somCreated] 		= true;

	        SomInfo[x][somWorld]        = GetPlayerVirtualWorld(playerid);

	        SomInfo[x][somVida] 		= 100.0;

	        SomInfo[x][somX] 			= Pos[0];
	        SomInfo[x][somY] 			= Pos[1];
	        SomInfo[x][somZ] 			= Pos[2]-0.95;
	        SomInfo[x][somID]           = playerid;

	        format(SomInfo[x][somLink], 128, urlSound);

            SomInfo[x][somObject] 		= CreateDynamicObject(2226, SomInfo[x][somX], SomInfo[x][somY], SomInfo[x][somZ], 0.0, 0.0, Pos[3], SomInfo[x][somWorld]);

	        format(string, sizeof string, "-o))) Som de: %s", NomePlayer(playerid));

            SomInfo[x][somText]         = CreateDynamic3DTextLabel(string, 0x33CCFFF9, SomInfo[x][somX], SomInfo[x][somY], SomInfo[x][somZ]+0.3, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, SomInfo[x][somWorld]);

			return 1;
		}
	}

	return 1;
}
E o som desligado:
Code:
destroySound(id){

	if(SomInfo[id][somCreated]){

	    SomInfo[id][somCreated] = false;

	    DestroyDynamicObject(SomInfo[id][somObject]);
	    DestroyDynamic3DTextLabel(SomInfo[id][somText]);
	    SomInfo[id][somID] = 999;

	    foreach(Player, i){

	        if(IsPlayerInRangeOfPoint(i, 71.0, SomInfo[id][somX], SomInfo[id][somY], SomInfo[id][somZ]) && OuvindoSom[i] && GetPlayerVirtualWorld(i) == SomInfo[id][somWorld]){

	            StopAudioStreamForPlayer(i);
	            OuvindoSom[i] = false;
	        }
	    }
	}
}
LuanGamer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] O que tem de errado no meu comando de radio? pedrotvr Português/Portuguese 2 29/08/2015 12:54 PM
[Ajuda] Comando radio Streaming ...... LucasTadeu Português/Portuguese 2 22/02/2014 06:57 PM
[Ajuda] Warning no comando /R - Rádio rCr Português/Portuguese 7 30/03/2013 01:46 AM
BUG Comando /radio Pedro Pawno Português/Portuguese 10 29/03/2013 03:39 AM


All times are GMT. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.