I don't speak Noobish and Kakanasslickish.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuplayerIterator <- [];
function onPlayerJoin(player)
{
playerIterator.push(player.ID);
}
function onPlayerPart(player, reason)
{
playerIterator.remove(player.ID);
}
function onPlayerChat(player, text)
{
LocalMessage(player.Pos, 30.0, player.Name + " said: " + text, 255, 255, 255);
return 0;
}
function onPlayerCommand(player, cmd, text)
{
if(cmd == "me")
{
if(!text) return ClientMessage("SYNTAX: /me <action>", player, 255, 255, 255);
return LocalMessage(player.Pos, 30.0, "* " + player.Name + " " + text, 194, 162, 218);
}
if(cmd == "do")
{
if(!text) return ClientMessage("SYNTAX: /do <action>", player, 255, 255, 255);
return LocalMessage(player.Pos, 30.0, "* " + text + " (" + player.Name + ")", 70, 130, 180);
}
if(cmd == "b")
{
if(!text) return ClientMessage("SYNTAX: /b <text>", player, 255, 255, 255);
return LocalMessage(player.Pos, 30.0, "* (( " + player.Name + ": " + text + " ))", 255, 255, 255);
}
return ClientMessage("SERVER: Unknown command.", player, 255, 255, 255);
}
function GetPointDistanceToPoint(x1, y1, z1, x2, y2, z2)
{
return Vector(x1-x2, y1-y2, z1-z2).Length();
}
function LocalMessage(point, distance, message, R, G, B)
{
foreach(playerid, val in playerIterator)
{
if(GetPointDistanceToPoint(FindPlayer(playerid).Pos.x, FindPlayer(playerid).Pos.y, FindPlayer(playerid).Pos.z, point.x, point.y, point.z) < distance)
{
ClientMessage(message, FindPlayer(playerid), R, G, B);
}
}
}