TH3RM4L Posted January 24, 2018 Posted January 24, 2018 (edited) Hello. I'm new at scripting and I've been struggling to make a simple time/weather changer. I tried to do it like this: mp.events.addCommand('time', (player, _, timeA) => { if (timeA().length > 0) { setTime(parseInt(timeA)); } }); mp.events.addCommand('weather', (player, _, weatherA) => { if (weatherA().length > 0) { setWeather(parseInt(weatherA)); } }); Could anyone, if kind enough, show me how to properly make this work? I wanna learn how to do this stuff Thanks in advance. Edited January 24, 2018 by TH3RM4L
ragempdev Posted January 25, 2018 Posted January 25, 2018 2 hours ago, TH3RM4L said: setTime(parseInt(timeA)); mp.world.time.hour = parseInt(timeA); 2 hours ago, TH3RM4L said: setWeather(parseInt(weatherA)); mp.world.weather = weatherA; 2 hours ago, TH3RM4L said: if (timeA().length > 0) () not needed. It's not a function, it's a variable. 1
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