zombienation Posted February 4, 2012 Share Posted February 4, 2012 hello, i got this when a player die or login [2012-02-05 13:57:17] WARNING: zombiegamemode\teamjobs.lua:256: Bad argument @ 'getPlayerTeam' local playerTeam = getPlayerTeam (Player ) how can i fix this? thanks Link to comment
GanJaRuleZ Posted February 4, 2012 Share Posted February 4, 2012 'Player' isn't definied. Link to comment
zombienation Posted February 4, 2012 Author Share Posted February 4, 2012 how can i fix it so the warning stops showing? Link to comment
drk Posted February 4, 2012 Share Posted February 4, 2012 Try changing 'Player' to 'source' or localPlayer() Link to comment
zombienation Posted February 4, 2012 Author Share Posted February 4, 2012 source dont change the warning with localplayer () i can an other warning [2012-02-05 19:13:59] ERROR: zombiegamemode\teamjobs.lua:256: attempt to call global 'localPlayer' (a nil value) Link to comment
Kenix Posted February 4, 2012 Share Posted February 4, 2012 https://wiki.multitheftauto.com/wiki/Event localPlayer used only in client side. viewtopic.php?f=91&t=39678 Link to comment
drk Posted February 4, 2012 Share Posted February 4, 2012 https://wiki.multitheftauto.com/wiki/EventlocalPlayer used only in client side. viewtopic.php?f=91&t=39678 My bad Sorry Link to comment
drk Posted February 4, 2012 Share Posted February 4, 2012 Please show the whole code. Link to comment
zombienation Posted February 4, 2012 Author Share Posted February 4, 2012 local playerTeam = getPlayerTeam localPlayer() Link to comment
drk Posted February 4, 2012 Share Posted February 4, 2012 lol? Its your whole code? For this: function example(thePlayer) local playerTeam = getPlayerTeam(thePlayer) end Link to comment
BinSlayer1 Posted February 4, 2012 Share Posted February 4, 2012 If that is your whole code then you have no idea where to begin, so I'm suggesting: https://wiki.multitheftauto.com/wiki/Scr ... troduction you can't use random variable names like 'player'. They must be defined somewhere or passed via other functions Just check the wiki and read some of the examples there Link to comment
GanJaRuleZ Posted February 4, 2012 Share Posted February 4, 2012 Well , i think you are to lazy to look out the error [2012-02-05 13:57:17] WARNING: zombiegamemode\teamjobs.lua:256: Bad argument @ 'getPlayerTeam' Here : 'teamjobs.lua:256:' that means that it isn't his full code , but i don't think he has anyreason to post here the whole code @Zombienation Here is a little lection If you use it in clientside function createTeam() local team = getPlayerTeam(localPlayer) if team then return team else return N/A end end If you want to use it in serverside --clientside function sendInformation() local thePlayer = getLocalPlayer() triggerServerEvent("getInformation", localPlayer , thePlayer) end --serverside function getTheInformation() getPlayerTeam( thePlayer ) end addEvent ( "getInformation", true ) addEventHandler ( "getInformation", getRootElement(), getTheInformation ) OR You can try NVIDIAS way Link to comment
Kenix Posted February 4, 2012 Share Posted February 4, 2012 GanJaRuleZ,Your code is wrong. https://wiki.multitheftauto.com/wiki/Scr ... troduction http://www.lua.org/manual/5.1/manual.html Link to comment
GanJaRuleZ Posted February 5, 2012 Share Posted February 5, 2012 Well , i didn't wanted to make a working one , i wanted to show him some examples how to make it.. Link to comment
zombienation Posted February 11, 2012 Author Share Posted February 11, 2012 Well , i think you are to lazy to look out the error [2012-02-05 13:57:17] WARNING: zombiegamemode\teamjobs.lua:256: Bad argument @ 'getPlayerTeam' Here : 'teamjobs.lua:256:' that means that it isn't his full code , but i don't think he has anyreason to post here the whole code @Zombienation Here is a little lection If you use it in clientside function createTeam() local team = getPlayerTeam(localPlayer) if team then return team else return N/A end end If you want to use it in serverside --clientside function sendInformation() local thePlayer = getLocalPlayer() triggerServerEvent("getInformation", localPlayer , thePlayer) end --serverside function getTheInformation() getPlayerTeam( thePlayer ) end addEvent ( "getInformation", true ) addEventHandler ( "getInformation", getRootElement(), getTheInformation ) OR You can try NVIDIAS way hey ganja.. i got it to work lol but, is it possible to add a code in it that saves the skin when a player dies? thx thanks Link to comment
drk Posted February 11, 2012 Share Posted February 11, 2012 Well , i think you are to lazy to look out the error [2012-02-05 13:57:17] WARNING: zombiegamemode\teamjobs.lua:256: Bad argument @ 'getPlayerTeam' Here : 'teamjobs.lua:256:' that means that it isn't his full code , but i don't think he has anyreason to post here the whole code @Zombienation Here is a little lection If you use it in clientside function createTeam() local team = getPlayerTeam(localPlayer) if team then return team else return N/A end end If you want to use it in serverside --clientside function sendInformation() local thePlayer = getLocalPlayer() triggerServerEvent("getInformation", localPlayer , thePlayer) end --serverside function getTheInformation() getPlayerTeam( thePlayer ) end addEvent ( "getInformation", true ) addEventHandler ( "getInformation", getRootElement(), getTheInformation ) OR You can try NVIDIAS way And you are too lazy to see that I said "Post the whole code". Link to comment
zombienation Posted February 11, 2012 Author Share Posted February 11, 2012 draken, its not that i'm lazy, its just that its about my team functions and i dont wanna just give that all away cuz there is stuff in it changed by myself, i can show u in PM Link to comment
drk Posted February 11, 2012 Share Posted February 11, 2012 (edited) "And you are too lazy" - I'm not talking about u Edited February 11, 2012 by Guest Link to comment
zombienation Posted February 11, 2012 Author Share Posted February 11, 2012 whatever you say man Link to comment
drk Posted February 11, 2012 Share Posted February 11, 2012 Shit, sorry LOL I'm crazy today, read my last post again .-. Link to comment
zombienation Posted February 11, 2012 Author Share Posted February 11, 2012 Haha omg. I already smoked to much i think at this point sorry man its my mistake 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