Knife from kitchen HELP
#7

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
Example:

Somewhere in your script:
pawn Код:
stock MeMessage(color, string[])
{
    new Float:x, Float:y, Float:z;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
       GetPlayerPos(i, x, y, z);

            if(IsPlayerInRangeOfPoint(i, x, y, z, 10.0))
            {
                SendClientMessage(i, color, string);
            }
        }
    }
return 1;
}
The command, at OnPlayerCommandText
Make a command, like /knifeout, then check if the player who types /knifeout is located at the coordinates if your kitchen,
if he's near the kitchen then make it send this message:
pawn Код:
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "* %s  took a knife from the drawer", playername);
MeMessage(COLOR_WHITE, string);
Not tested, not sure if it works.
IsPlayerInRange is bad implemented. The second parameter is the range, not the Float X, and the last one is Float Z. Just pointing it out.
Reply


Messages In This Thread
Knife from kitchen HELP - by Bluebay - 18.03.2011, 20:44
Re: Knife from kitchen HELP - by Rivera - 18.03.2011, 20:57
Re: Knife from kitchen HELP - by admantis - 18.03.2011, 20:58
Re: Knife from kitchen HELP - by Rivera - 18.03.2011, 21:00
Re: Knife from kitchen HELP - by austin070 - 18.03.2011, 21:01
Re: Knife from kitchen HELP - by Biesmen - 18.03.2011, 21:04
Re: Knife from kitchen HELP - by admantis - 18.03.2011, 21:08
Re: Knife from kitchen HELP - by Bluebay - 18.03.2011, 21:13
Re: Knife from kitchen HELP - by austin070 - 18.03.2011, 21:16
Re: Knife from kitchen HELP - by Biesmen - 18.03.2011, 21:16

Forum Jump:


Users browsing this thread: 1 Guest(s)