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.