SendClientMessage Spamming
#1

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;
}
Reply
#2

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

still spamming
Reply
#4

fixed thanks
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)