Please Check
#1

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!!
Reply
#2

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.
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)