itsMatheus Posted March 4, 2016 Share Posted March 4, 2016 (edited) So, first... I'm really noob at programming, and I was trying to create a spawn screen script... But when the even is called, it calls all the commands but the spawnPlayer... It says it is expecting a player at argument 1, but i really don't know what to put in there. I've looked a lot of MTA Wiki pages, tried a lot of things but i can't make it work. It could be a really stupid thing, but as I said, im really new at programming. Thanks to CodyL, for the fix Edited March 5, 2016 by Guest Link to comment
itsMatheus Posted March 4, 2016 Author Share Posted March 4, 2016 I tried "source" already, it still does the same thing Link to comment
1LoL1 Posted March 4, 2016 Share Posted March 4, 2016 Post the "onSpawnPoliceOfficerLS" Link to comment
Mann56 Posted March 4, 2016 Share Posted March 4, 2016 Can you show us how you called onSpawnPoliceOfficerLS? Also, if you want you can just post your code in [lua] and [ / lua] tags instead of uploading photos to another website and showing, might save you some time. Link to comment
Captain Cody Posted March 4, 2016 Share Posted March 4, 2016 change player source to client assuming this is a server side script and being called from a client side. If not, post the section of code that calls this function. You may need to put (PlayerSource) in the brackets for this function if it is being sent over by the calling function. Link to comment
itsMatheus Posted March 5, 2016 Author Share Posted March 5, 2016 This is the client side script: rootElement = getRootElement() -- Lots of things in between... function spawnPoliceOfficerLS ( button ) if button == "left" then triggerServerEvent("onSpawnPoliceOfficerLS", rootElement) end end It calls the server side when player click the button to spawn. Link to comment
Captain Cody Posted March 5, 2016 Share Posted March 5, 2016 Use replace playersource, and source with client. Link to comment
itsMatheus Posted March 5, 2016 Author Share Posted March 5, 2016 I'm sorry CodyL, I didn't get it... Link to comment
Captain Cody Posted March 5, 2016 Share Posted March 5, 2016 in the PoliceOfficerLS function replace source playerSource with client You are calling a server side event from a client side even, when triggering a server side event it does not pass the player as source, instead of passes the player as 'client'. Link to comment
itsMatheus Posted March 5, 2016 Author Share Posted March 5, 2016 It worked! Thank you CodyL You saved me hours of searching on MTA Wiki 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