MR.GRAND Posted April 21, 2016 Posted April 21, 2016 (edited) Hello guys look at this player[source] = getPlayerSerial(source) this player source for get player serial i put it in event # addEventHandler( 'onVehicleStartEnter', resourceRoot, function(thePlayer) if (getPlayerSerial(thePlayer) ~= player[thePlayer]) then cancelEvent() outputChatBox(tostring(player[thePlayer]).."2222") else outputChatBox(tostring(player[thePlayer])) end end) here i check if the player == player[source] in that event or not if not he can't enter in that car to now the code ok but if another one create car ___ i can enter to his car and he can enter to my car so all that is bug anyone can help me ? i want only this one player[source] = getPlayerSerial(source) can enter to his car as a driver and another one can not enter as a driver Heeelpppp Edited April 21, 2016 by Guest My new GCSS Script : Go حصريا : مود الدردشة بين السيرفرات : الذهاب LUA progress = -100% Join us : Multi Theft Auto Arab I'm not the best but, i'm different Skype : kamel1234128 Someone in this world needs to remember my love .
Simple0x47 Posted April 21, 2016 Posted April 21, 2016 Did you make player a table? Because I think it's a pre-defined variable. So make a table p = {}. "Keep making it simplex."
MR.GRAND Posted April 21, 2016 Author Posted April 21, 2016 Did you make player a table? Because I think it's a pre-defined variable. So make a table p = {}. Vehicle_ = {} player = {} addEvent('createUSERcar', true) addEventHandler( 'createUSERcar', root, function(getCarID, Serial) local x, y, z = getElementPosition(source) if (not isElement(Vehicle_[source])) then Vehicle_[source] = createVehicle( getCarID, x + 2, y + 2, z + 1) else destroyElement(Vehicle_[source]) Vehicle_[source] = createVehicle( getCarID, x + 2, y + 2, z + 1) end end ) help ? My new GCSS Script : Go حصريا : مود الدردشة بين السيرفرات : الذهاب LUA progress = -100% Join us : Multi Theft Auto Arab I'm not the best but, i'm different Skype : kamel1234128 Someone in this world needs to remember my love .
MR.GRAND Posted April 21, 2016 Author Posted April 21, 2016 Hello ??? My new GCSS Script : Go حصريا : مود الدردشة بين السيرفرات : الذهاب LUA progress = -100% Join us : Multi Theft Auto Arab I'm not the best but, i'm different Skype : kamel1234128 Someone in this world needs to remember my love .
MR.GRAND Posted April 21, 2016 Author Posted April 21, 2016 No one can help ? ((((( My new GCSS Script : Go حصريا : مود الدردشة بين السيرفرات : الذهاب LUA progress = -100% Join us : Multi Theft Auto Arab I'm not the best but, i'm different Skype : kamel1234128 Someone in this world needs to remember my love .
MR.GRAND Posted April 22, 2016 Author Posted April 22, 2016 No one can replay ? My new GCSS Script : Go حصريا : مود الدردشة بين السيرفرات : الذهاب LUA progress = -100% Join us : Multi Theft Auto Arab I'm not the best but, i'm different Skype : kamel1234128 Someone in this world needs to remember my love .
Moderators IIYAMA Posted April 22, 2016 Moderators Posted April 22, 2016 use the serial as key: local serialToPlayer = {} serialToPlayer[getPlayerSerial(source)] = source if serialToPlayer[getPlayerSerial(thePlayer)] then Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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