Found the lost infobox (M4tr1x)

This commit is contained in:
VegaZ
2018-09-27 21:27:24 +02:00
parent bd8c0a7f7d
commit 7c4c952fb1
2 changed files with 39 additions and 7 deletions

View File

@@ -5,11 +5,11 @@
*/
var currentdate;
var dateString;
var timeString;
var draw = false;
var draw = false;
let posX = 0.92;
let posY = 0.45;
let width = 0.1;
@@ -32,8 +32,14 @@ var nHour;
var nMinute;
var nSecond;
mp.events.add("draw", () => {
var playerName;
var playerId;
mp.events.add("draw", (pName, pId) => {
playerName = pName;
playerId = pId;
draw = true;
});
mp.events.add("render", () => {
@@ -105,10 +111,36 @@ mp.events.add("render", () => {
}
timeString = "~r~Datum: ~s~" + nDay + ". " + nMonth + " " + year + "\n~r~Uhrzeit: ~s~" + nHour + ":" + nMinute + ":" + nSecond + " Uhr";
mp.game.graphics.drawRect(posX, posY, width, height, colorR, colorG, colorB, colorA);
mp.game.graphics.drawText(timeString, [0.92, 0.35],
dateString = nDay + ". " + nMonth + " " + year;
timeString = nHour + ":" + nMinute + ":" + nSecond + " Uhr";
mp.game.graphics.requestStreamedTextureDict("digitaloverlay", true);
//static
mp.game.graphics.drawSprite("digitaloverlay", "static1", posX, posY, width, height, 0, 0, 255, 0, 88);
//mp.game.graphics.drawRect(posX, posY, width, height, colorR, colorG, colorB, colorA);
mp.game.graphics.drawText(playerName + " (" + playerId + ")", [0.92, 0.351],
{
font: 4,
color: [255, 255, 255, 255],
scale: [0.5, 0.5],
outline: true
})
mp.game.graphics.drawText(dateString + "\n" + timeString, [0.938, 0.381],
{
font: 4,
color: [255, 255, 255, 255],
scale: [0.5, 0.5],
outline: true
})
mp.game.graphics.drawText("~r~Datum: ", [0.89, 0.381],
{
font: 4,
color: [255, 255, 255, 255],
scale: [0.5, 0.5],
outline: true
})
mp.game.graphics.drawText("~r~Uhrzeit: ", [0.891, 0.411],
{
font: 4,
color: [255, 255, 255, 255],

View File

@@ -46,7 +46,7 @@ namespace reallife_gamemode.Server.Events
player.SetData("isLoggedIn", true);
player.SetData("spec", true);
player.TriggerEvent("draw");
player.TriggerEvent("draw", player.Name, player.Handle.Value);
player.Position = new Vector3(user.PositionX, user.PositionY, user.PositionZ);
}
}