linglingthething Posted September 15, 2018 Posted September 15, 2018 Hey hey I Got a question. At GT-MP i can set a timer like this Task.Run(() => { CharacterTimer = API.SetTimer(60000, false, () => { API.getAllPlayers().ForEach(client => { if (client.hasData("player")) { Player player = client.getData("player"); if (player.Character != null) { player.Character.Position = client.position; player.Character.Rotation = client.rotation; CharacterService.UpdatePlayerWeapons(player.Character); if (!player.Character.IsDeath) { player.Character.Hunger -= 2; player.Character.Thirst -= 3; if (player.Character.Thirst <= 20) { NAPI.Notification.SendNotificationToPlayer(client, "Du hast für eine weile nix mehr getrunken!"); } if (player.Character.Hunger <= 15) { NAPI.Notification.SendNotificationToPlayer(client, "Du hast für eine seit einer weile nix mehr gegessen!"); } if (player.Character.Hunger <= 0 || player.Character.Thirst <= 0) { client.health -= 10; } CharacterService.UpdateHUD(client); } } } }); }); }); But how can i do it at Rage MP? because API.setTimer is not supported. i Hope anyone can help me to solve this little problem.
Robson Posted September 15, 2018 Posted September 15, 2018 (edited) https://www.w3schools.com/jsref/met_win_setinterval.asp or https://www.w3schools.com/jsref/met_win_settimeout.asp dependes on your need Edited September 15, 2018 by Robson
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now