buxx0 Posted August 29, 2017 Share Posted August 29, 2017 (edited) Hey. I have some code, example commands that I made are working fine. I can't get player.call to work. I have no idea why. I'm beginner at node/js, previously I scripted some php but nevermind. events.js (packages/gamemode/) server-side - is working fine, console is logging "use strict"; mp.events.add('playerJoin', (player) => { console.log('playerJoin called by' + player.name); player.call('playerJoinHandler', player); // not working }); mp.events.addCommand('veh', (player) => { player.call('playerJoinHandler', player); // working }); events.js (client_packages/gamemode/) - not working "use strict"; mp.events.add('playerJoinHandler', (player) => { mp.gui.chat.push("test"); player.position = (0, 0, 0); }); I've spent half a day on it. I don't know that I'm retarded AF or what. I think few hours ago it was working, but it seemed random so I deleted everything and started from scratch. I guess I've done something wrong, but my commands were working fine. I only can't get playerJoin to work. I can't find answer on the wiki or in example freeroam so I'm asking here for explanation. Thank for ur time. Edited August 29, 2017 by buxx0 Link to comment Share on other sites More sharing options...
ragempdev Posted August 29, 2017 Share Posted August 29, 2017 Are you sure that your events.js was executed? Link to comment Share on other sites More sharing options...
buxx0 Posted August 29, 2017 Author Share Posted August 29, 2017 (edited) 1 hour ago, ragempdev said: Are you sure that your events.js was executed? It should be because if I gonna call playerJoinHandler from command at serverside, it's working. Edited August 29, 2017 by buxx0 Link to comment Share on other sites More sharing options...
JennyMatrix Posted January 20, 2018 Share Posted January 20, 2018 Same problem. Did you found a decision? Link to comment Share on other sites More sharing options...
Bonus Posted January 21, 2018 Share Posted January 21, 2018 @JennyMatrix Now the arguments need to be in an array (use brackets): player.call('playerJoinHandler', [player]); 1 Link to comment Share on other sites More sharing options...
deffo Posted January 28, 2018 Share Posted January 28, 2018 (edited) Working fine in 0.3.3, probably doesn't work in 0.2. Edited January 28, 2018 by deffo Link to comment Share on other sites More sharing options...
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