0xNull Posted January 30, 2018 Posted January 30, 2018 Hello! How create variable for each player? For example, if player type command "tomp" - his varialable chande to 1? Not all players, only for his? My code: mp.events.addCommand('tomp', (player) =>{ if (startmp == 1){ uch = true; } }); But it code - varialabe "uch" change if any player type "tomp", but need for himself. Please, help me)
iRandomXx Posted January 30, 2018 Posted January 30, 2018 Hi my friend ! I don't understand. You want a UCH boolean for each player ?
0xNull Posted January 31, 2018 Author Posted January 31, 2018 6 часов назад, iRandomXx сказал: Hi my friend ! I don't understand. You want a UCH boolean for each player ? It seems that I have already solved this problem, but this is not very accurate. Here's how: mp.events.addCommand('tomp', (player)=>{ if (startmp == 1){ player.uch = 1; } });
iRandomXx Posted January 31, 2018 Posted January 31, 2018 14 hours ago, 0xNull said: It seems that I have already solved this problem, but this is not very accurate. Here's how: mp.events.addCommand('tomp', (player)=>{ if (startmp == 1){ player.uch = 1; } }); This is accurate if do well what you want to do. mp.events.addCommand("tomp", (player) => { if(startmp == 1) player.uhc = 1; // What is startmp variable ? } Just remove brackets when you just use one function in a IF / ELSE, it's more beautiful looked ! No ?
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