14.09.2012, 10:27
I made this real quick for example purposes.
It simply follows the player around, wherever the player goes, and other players can see their position.
pawn Code:
new Text3D: TextID[MAX_PLAYERS];
public OnPlayerConnect(playerid) {
new Float: X,
Float: Y,
Float: Z;
GetPlayerPos(playerid, X, Y, Z);
TextID[playerid] = Create3DTextLabel("X: 0000.000000\nY: 0000.000000\nZ: 0000.000000\nA: 0000.000000", 0x008080FF, X, Y, Z);
return true;
}
public OnPlayerDisconnect(playerid, reason) {
Delete3DTextLabel(TextID[playerid]);
return true;
}
public OnPlayerUpdate(playerid) {
new Float: X,
Float: Y,
Float: Z,
Float: A,
String[100];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
format(String, 100, "X: %f\nY: %f\nZ: %f\nA: %f", X, Y, Z, A);
Update3DTextLabelText(TextID[playerid], 0x008080FF, String);
Attach3DTextLabelToPlayer(TextID[playerid], playerid, 0.0, 0.0, 1.0);
return true;
}