Please Check - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please Check (
/showthread.php?tid=69122)
Please Check -
StrickenKid - 16.03.2009
Can Someone more educated let me know if this whisper function that i made will work?
Thanks!
pawn Код:
stock SendClientWhisper(playerid,const str[])
{
new count=0;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
for (new i=0; i<MAX_PLAYERS; i++)
{
if ( PlayerToPoint(5.0,i,X,Y,Z) )
{
SendClientMessage(i, COLOR_WHITE, str);
count++;
}
}
return count;
}
If it works feel free to use it!
EDIT: YAH 200th POST HUGE CLUCKER!!
Re: Please Check -
Norn - 16.03.2009
Quote:
Originally Posted by <__Ethan__>
Can Someone more educated let me know if this whisper function that i made will work?
Thanks!
pawn Код:
stock SendClientWhisper(playerid,const str[]) { new count=0; new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); for (new i=0; i<MAX_PLAYERS; i++) { if ( PlayerToPoint(5.0,i,X,Y,Z) ) { SendClientMessage(i, COLOR_WHITE, str); count++; } } return count; }
If it works feel free to use it!
EDIT: YAH 200th POST HUGE CLUCKER!!
|
pawn Код:
stock SendClientWhisper(playerid,const str[],Float:X,Float:Y,Float:Z)
{
if (PlayerToPoint(5.0,playerid,X,Y,Z) )
{
SendClientMessage(playerid, COLOR_WHITE, str);
}
return 1;
}
Your check is useless, it's checking if there at the current xyz there at. Obviously they are.
And the rest is not needed.
EDIT: Nevermind i just realised what you wanted to do, it's 3am sorry. Yes your code will work.
Re: Please Check -
StrickenKid - 16.03.2009
ok thanks.
EDIT: heres the command i made for it if anyone would want to use it:
pawn Код:
if(strcmp(cmd, "/w", true) == 0)
{
if(!strlen(cmdtext[2])) return SendClientMessage(playerid,red,"Please Enter in a Message.");
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "Whisper %s (%d): %s",playername,playerid,cmdtext[2]);
SendClientWhisper(playerid,string);
return 1;
}