Overkillz Posted February 7, 2016 Share Posted February 7, 2016 These days Im getting stupid problems. IDK why this doesnt work function changelang() outputChatBox("Si functiona") end bindKey( source, "F1", "down", changelang ) Its server side (I wont do it client side) Debugscript says something wrong at bindkey argument 1 I hope u can tell me why it doesnt do that. Regards Link to comment
ViRuZGamiing Posted February 7, 2016 Share Posted February 7, 2016 in what function is this? which event's source. Link to comment
Overkillz Posted February 7, 2016 Author Share Posted February 7, 2016 It needs to be inside another function ? Link to comment
ViRuZGamiing Posted February 7, 2016 Share Posted February 7, 2016 your first argument should be the player who gets the command, source is a source of an event in this case source is undefined. If you wouldn't want to use source you should do it clientside since it requires not player argument. You can for example loop through all players, serversided and attach the command too. Most events have the player of cause as the source but always double check the source on the wiki, sometimes it's a vehicle or a marker, ... Link to comment
SpecT Posted February 7, 2016 Share Posted February 7, 2016 You need to bind it for everyone and when a player joins. Like this: addEventHandler("onPlayerJoin",root, function () bindKey( source, "F1", "down", changelang ) end ) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey( player, "F1", "down", changelang ) end end ) Link to comment
Overkillz Posted February 7, 2016 Author Share Posted February 7, 2016 Yeah, I got you, Thanks man. Link to comment
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