SA-MP Forums Archive
SendClientMessage Spamming - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SendClientMessage Spamming (/showthread.php?tid=572697)



SendClientMessage Spamming - haridz - 01.05.2015

the sendclientmessage /stopstream spamming

Код:
CMD:stream(playerid,params[])
{
    new url[200];
    if(sscanf(params,"s[200]", url)) return SendClientMessage(playerid, 0x9C9C9CAA, "Syntax: /stream [url]");
    foreach(new i: Player)
    {
       if(IsPlayerVipType(playerid,3))
	   {
	       PlayAudioStreamForPlayer(i, url);
	       new string[64], pName[MAX_PLAYER_NAME];
	       GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
	       format(string,sizeof string,"%s has stream the music [%s]",pName, url);
	       SendClientMessageToAll(0xF0F8FFAA, "Use /stopstream to stop the song");
	   }
	   else return SendClientMessage(playerid, 0xAA3333AA, "ERROR: THIS COMMAND IS FOR VIP PREMIUM");
    }
    return 1;
}

CMD:stopstream(playerid,params[])
{
    StopAudioStreamForPlayer(playerid);
	return 1;
}



Re: SendClientMessage Spamming - Crayder - 01.05.2015

change
SendClientMessageToAll(0xF0F8FFAA, "Use /stopstream to stop the song");
to
SendClientMessage(i, 0xF0F8FFAA, "Use /stopstream to stop the song");


Re: SendClientMessage Spamming - haridz - 01.05.2015

still spamming


Re: SendClientMessage Spamming - haridz - 01.05.2015

fixed thanks


Re: SendClientMessage Spamming - Crayder - 01.05.2015

I hope you see this...
Код:
CMD:stream(playerid,params[])
{
	if(!IsPlayerVipType(playerid,3)) 
		return SendClientMessage(playerid, 0xAA3333AA, "ERROR: THIS COMMAND IS FOR VIP PREMIUM");

	new url[200], string[64], pName[MAX_PLAYER_NAME];
	if(sscanf(params,"s[200]", url)) 
		return SendClientMessage(playerid, 0x9C9C9CAA, "Syntax: /stream [url]");

	foreach(new i: Player)
		PlayAudioStreamForPlayer(i, url);

	GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
	format(string,sizeof string,"%s has stream the music [%s]",pName, url);
	SendClientMessageToAll(0xF0F8FFAA, string);
	SendClientMessageToAll(0xF0F8FFAA, "Use /stopstream to stop the song");
	return 1;
}

CMD:stopstream(playerid,params[])
{
	StopAudioStreamForPlayer(playerid);
	return 1;
}
This is way more proper. Sorry I was in a rush earlier, I was in the grocery store using my phone... XD