PDA

View Full Version : SendClientMessage Bug


Blackazur
05/12/2013, 09:35 PM
Hello, i have a bug if i look now on my stats i get the message too that im looking at my own stats, but how to make that it only show when a different player looking at my stats?

format(str2, sizeof(str2),""chat""COL_GREEN" %s (%d) is looking at your stats using /stats [playerid].", PlayerName(playerid), playerid);
SendClientMessage(targetid,-1,str2);

Misiur
05/12/2013, 09:58 PM
Wrap that code in conditional comparing targetid with playerid.

Blackazur
05/12/2013, 09:59 PM
Can you do it for me because i dont understand so well?

Tayab
06/12/2013, 12:36 AM
if(targetid == playerid)
{
format(str2, sizeof(str2),""chat""COL_GREEN" %s (%d) is looking at your stats using /stats [playerid].",PlayerName(playerid), playerid);
SendClientMessage(targetid,-1,str2);
}

[CG]Milito
06/12/2013, 12:52 AM
if(targetid != playerid)
{
new str2[80];
format(str2, sizeof(str2),""chat""COL_GREEN" %s (%d) is looking at your stats using /stats [playerid].", PlayerName(playerid), playerid);
SendClientMessage(targetid,-1,str2);
}