Get players position (multiplayer)
by Kiyaku · in Torque Game Engine Advanced · 09/04/2008 (1:24 pm) · 1 replies
Hi,
i'm trying to script a chat where i can send messages in a specific range. I know how to check for objects in a specific radius but i can't get the players position so i can place the "scanner" at his position.
I read it should work with %client.player.getPosition()" but that doesnt work. "%player.getPosition()" doesnt work either.
So how can i check for the clients position?
I use the Stronghold level as playground.
i'm trying to script a chat where i can send messages in a specific range. I know how to check for objects in a specific radius but i can't get the players position so i can place the "scanner" at his position.
I read it should work with %client.player.getPosition()" but that doesnt work. "%player.getPosition()" doesnt work either.
So how can i check for the clients position?
I use the Stronghold level as playground.
Torque Owner Kiyaku
function serverCmdTeamMessageSent(%client, %text) { if(strlen(%text) >= $Pref::Server::MaxChatLen) %text = getSubStr(%text, 0, $Pref::Server::MaxChatLen); %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %client2 = ClientGroup.getObject(%i); if(VectorDist(%client.player.getPosition(), %client2.player.getPosition()) < 100) { ...