Sande Posted July 22, 2013 Share Posted July 22, 2013 Hey, i try to start godmode with these script. This works on mtasa 1.3.2 but not 1.3.3. I didnt see any triggerClientEvent changes on wiki so whats wrong. Server: function godmode() local team = getPlayerTeam ( source ) if getTeamName (team) == "Freeroam" then triggerClientEvent(source, "goFreeroam", source) end end addEventHandler("onPlayerLogin", getRootElement(), godmode ) Client: addEvent("goFreeroam", true) addEventHandler("goFreeroam", root, function() executeCommandHandler("godmode") end ) Link to comment
Castillo Posted July 22, 2013 Share Posted July 22, 2013 It could be that the client side is not yet loaded. Link to comment
Vector Posted July 22, 2013 Share Posted July 22, 2013 why you don´t do this --> function godmode() local team = getPlayerTeam ( source ) if getTeamName (team) == "Freeroam" then extecuteCommandHandler ("godmode", source); end end addEventHandler("onPlayerLogin", getRootElement(), godmode ) Link to comment
Castillo Posted July 22, 2013 Share Posted July 22, 2013 That should also work, as far as I know. P.S: You got a typo there: "extecuteCommandHandler " instead of "executeCommandHandler". Link to comment
Vector Posted July 22, 2013 Share Posted July 22, 2013 I think is better cause you don´t have to add a clientside-script (avoid client-side when you think you can do it server-side) Link to comment
Sande Posted July 22, 2013 Author Share Posted July 22, 2013 Are there someway do that in clientside? If are can someone say how. (WITH OUT onClientRecourceStart) Link to comment
Castillo Posted July 22, 2013 Share Posted July 22, 2013 function godmode ( ) local team = getPlayerTeam ( source ) if ( team and getTeamName ( team ) == "Freeroam" ) then executeCommandHandler ( "godmode", source ) end end addEventHandler ( "onPlayerLogin", getRootElement(), godmode ) That code doesn't work? Link to comment
Sande Posted July 22, 2013 Author Share Posted July 22, 2013 Yes it working on my mtasa 1.3.2) testserver. But not in main server (1.3.3) and not second test server (1.3.3) so idk what wrong. 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