17.02.2017, 18:45
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.
Caso precise o cуdigo de criaзгo:
E o som desligado:
PHP Code:
CMD:destruirradio(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 1337 && isPertoSound(playerid))
{
for(new x; x != MAX_SOUNDS; x++)
{
if(SomInfo[x][somCreated] && SomInfo[x][somID] == playerid)
{
destroySound(x);
}
}
}
}
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; }
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; } } } }