Nerses Posted May 15, 2015 Posted May 15, 2015 Let ' em have it. Problem: [2015-05-16 02:48:49] ERROR: [gameplay]/bpsmoke/server.lua:8: exports: Call to non-running server resource (bone_attach) [string "?"] [2015-05-16 02:50:49] WARNING: [gameplay]/bpsmoke/server.lua:12: Bad argument @ 'destroyElement' [Expected element at argument 1] here is the script itself local cigarettes = { } local timer = 2*60000 function cigarette(thePlayer) if ( not isElement ( cigarettes [ thePlayer ] ) ) then local x, y, z = getElementPosition ( thePlayer ) cigarettes [ thePlayer ] = createObject ( 1485, 0, 0, 0 ) exports [ "bone_attach" ]:attachElementToBone ( cigarettes [ thePlayer ], thePlayer,1, 0.07, 0.02, 0.07, 0, 50, 118 ) else outputChatBox ( "Вы еще не докурили!", thePlayer,255,0,0 ) end setTimer(destroyElement,timer,1, cigarettes [ thePlayer ] ) end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, ";", "down", cigarette ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, ";", "down", cigarette ) end end )
Walid Posted May 15, 2015 Posted May 15, 2015 You need this ;Click Me! About the warning this is how you can fix it function cigarette(thePlayer) if ( not isElement ( cigarettes [ thePlayer ] ) ) then local x, y, z = getElementPosition ( thePlayer ) cigarettes [ thePlayer ] = createObject ( 1485, 0, 0, 0 ) exports [ "bone_attach" ]:attachElementToBone ( cigarettes [ thePlayer ], thePlayer,1, 0.07, 0.02, 0.07, 0, 50, 118 ) else outputChatBox ( "Вы еще не докурили!", thePlayer,255,0,0 ) end setTimer(function(player) if isElement(cigarettes [player]) then destroyElement(cigarettes [player]) end end,timer,1,thePlayer) end 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
Nerses Posted May 15, 2015 Author Posted May 15, 2015 You need this ;Click Me!About the warning this is how you can fix it function cigarette(thePlayer) if ( not isElement ( cigarettes [ thePlayer ] ) ) then local x, y, z = getElementPosition ( thePlayer ) cigarettes [ thePlayer ] = createObject ( 1485, 0, 0, 0 ) exports [ "bone_attach" ]:attachElementToBone ( cigarettes [ thePlayer ], thePlayer,1, 0.07, 0.02, 0.07, 0, 50, 118 ) else outputChatBox ( "Вы еще не докурили!", thePlayer,255,0,0 ) end setTimer(function(player) if isElement(cigarettes [player]) then destroyElement(cigarettes [player]) end end,timer,1,thePlayer) end I don't know:(
Walid Posted May 15, 2015 Posted May 15, 2015 I don't know:( What ?? 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
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