11.03.2014, 12:54
pawn Code:
#include <a_samp>
static bool:NaoFloda[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/ligarsom", true))
{
if(NaoFloda[playerid] == false)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
NaoFloda[playerid] = true;
for(new i = 0; i <= GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 30.0, Pos[0], Pos[1], Pos[2]))
{
PlayAudioStreamForPlayer(i, "http://dl.dropboxusercontent.com/s/wkq9pvf6dsgraz4/MC_Marcelly_Bigode_Grosso__CLIPE_OFICIAL__TOM_PRODU_ES_2013.mp3", X, Y, Z, Distance, 1);
}
}
}
}
return 1;
}
if(!strcmp(cmdtext, "/desligarsom", true))
{
if(NaoFloda[playerid] == false)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
NaoFloda[playerid] = false;
for(new i = 0; i <= GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 30.0, Pos[0], Pos[1], Pos[2]))
{
StopAudioStreamForPlayer(i)
}
}
}
}
return 1;
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
Nгo entendo muito Portuguкs :/