Brad96 Posted June 12, 2015 Posted June 12, 2015 hi ,i want to explainme how i am use the bindKey function in server-side this is my script ,i want to create a vehicle when i press the key ,thanks function cas(player,key) x, y, z = getElementPosition(player) cs = createVehicle (411 ,x+5 ,y, z) css = createObject (359, x, y, z) css2 = createObject (359, x, y, z) x, y, z = getElementRotation ( cs ) attachElements ( css, cs, 1, 2, 0.20, 0, 0, 90) attachElements ( css2, cs, -1, 2, 0.20, 0, 0, 90) end addEventHandler("onResourceStart",getRootElement(),function () bindKey(player,"2","down",cas) end) Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Walid Posted June 12, 2015 Posted June 12, 2015 function FunctionName() for index, player in pairs(getElementsByType("player")) do bindKey(player,"2","down",cas) end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), FunctionName ) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Brad96 Posted June 12, 2015 Author Posted June 12, 2015 thanks ,but with a simple functions ? Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Walid Posted June 12, 2015 Posted June 12, 2015 thanks ,but with a simple functions ? i think it's very simple Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Brad96 Posted June 12, 2015 Author Posted June 12, 2015 is this? function cas(player) x, y, z = getElementPosition(player) cs = createVehicle (411 ,x+5 ,y, z) css = createObject (359, x, y, z) css2 = createObject (359, x, y, z) x, y, z = getElementRotation ( cs ) attachElements ( css, cs, 1, 2, 0.20, 0, 0, 90) attachElements ( css2, cs, -1, 2, 0.20, 0, 0, 90) end function FunctionName() for index, player in pairs(getElementsByType("player")) do bindKey(player,"2","down",cas) end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), FunctionName ) Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Walid Posted June 12, 2015 Posted June 12, 2015 yep try it. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Brad96 Posted June 12, 2015 Author Posted June 12, 2015 thanks so mucho but i dont understand this line for index, player in pairs(getElementsByType("player")) do you can explainme? pls Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Walid Posted June 12, 2015 Posted June 12, 2015 getElementsByType("player"): retrieves a table of the players in the server Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Brad96 Posted June 13, 2015 Author Posted June 13, 2015 and how i did the script whitout that line ,that function is complicated for me Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Tekken Posted June 13, 2015 Posted June 13, 2015 Try this: function FunctionName() bindKey(source, "2", "down", cas) end addEventHandler("onPlayerJoin", root, FunctionName) Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
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