Jump to content

manve1

Retired Staff
  • Posts

    1,283
  • Joined

  • Last visited

Everything posted by manve1

  1. manve1

    please help me

    fixed what you guys said.. now it doesn't even create the object, here is lua local hRow = nil local x, y, z = getElementPosition ( source ) hWnd = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ); hButton_use = guiCreateButton( 0.1, 0.725, 0.5, 0.1, "Use", true, hWnd ); hButton_close = guiCreateButton( 0.1, 0.85, 0.5, 0.1, "Close", true, hWnd ); local aObjects = { { "Bottle", 1512 }, { "Flower pot", 742 }, { "Bin", 1362 }, { "Fan", 14527 }, { "WW1 hat", 2052 }, { "WW2 hat", 2053 }, }; hGrid = guiCreateGridList( 0.1, 0.10, 0.8, 0.60, true, hWnd ); guiGridListAddColumn( hGrid, "ZM hats", 0.85 ); for i,m_obj in ipairs( aObjects ) do hRow = guiGridListAddRow( hGrid ); -- guiGridListSetItemText ( hGrid, hRow, 1, tostring( m_obj [ 1 ] ), false, false ); guiGridListSetItemData ( hGrid, hRow, 1, tostring( m_obj [ 2 ] ) ); end function use ( ) local row, col = guiGridListGetSelectedItem ( hGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( hGrid, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end object = createObject ( model, x, y, z + 0.8, 0, 0, 0 ) attachElements ( object, localPlayer, x, y, z) end end addEventHandler ( "onClientGUIClick", hButton_use, use, false )
  2. manve1

    please help me

    You telling me that im not trying to learn using MTA wiki? then why the F*** is it up? And what you MTA team posted and don't even understand at all...that's why its confusing for me.. EDIT: i made new LUA, as you told me too, but it still doesn't do it, i am still confused on how to make attachElements right, but i made another that should of worked, but idk why it just doesn't function use ( ) local row, col = guiGridListGetSelectedItem ( hGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local model = tonumber ( guiGridListGetItemData ( hGrid, row, 1 ) ) local x, y, z = getElementPosition ( localPlayer ) if ( isElement ( object ) ) then destroyElement ( object ) end object = createObject ( model, x, y, z + 0.8, 0, 0, 0 ) object = createObject ( model, x, y, z + 0.8, 0, 0, 0 ) attachElements ( object, source, x, y, z) end end addEventHandler ( "onClientGUIClick", hButton_use, use, false )
  3. manve1

    please help me

    you got me so confused for 5th time, can you just make a script? cuz you always nearly make me confused, thx
  4. manve1

    please help me

    this wroked, thanx, but 2 more questions 1. how do i attach it to players head 2. when he clicks use and then on other object, how i make that first one gets deleted?
  5. How can i make that when i select object on grid list and i press a button, it will be created by side, or on his head, here is LUA local hRow = nil; hWnd = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ); hButton_use = guiCreateButton( 0.1, 0.725, 0.5, 0.1, "Use", true, hWnd ); hButton_close = guiCreateButton( 0.1, 0.85, 0.5, 0.1, "Close", true, hWnd ); local aObjects = { "Gate", "Bottle", "Flower pot", "Bin", "Fan", "WW1 hat", "WW2 hat"; }; hGrid = guiCreateGridList( 0.1, 0.10, 0.8, 0.60, true, hWnd ); guiGridListAddColumn( hGrid, "ZM hats", 0.85 ); local x, y, z = getElementPosition() for i,m_obj in ipairs( aObjects ) do hRow = guiGridListAddRow( hGrid ); -- guiGridListSetItemText ( hGrid, hRow, 1, tostring( m_obj ), false, false ); end function use() if (source == "Gate" and hButton_use) then createObject( 980, x + 1, y, z, 0, 0, 0 ) end end addEventHandler("onClientGUIClick", hButton_use, aObjects )
  6. manve1

    Don't know how

    Like this never helps most people, can you give example with it?
  7. Can someone post me LUA code on how to make my LUA code to work? i tried re-making the whole script 10+ times.. and still i get same error.. it doesn't add text to gridList, thank you for helping. I know it is wrong, im just starting to script and learn LUA. gui = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ) objects = { "WW1 hat", "WW2 hat", } row = guiGridListAddRow ( grid ) myGridList = guiCreateGridList ( 0.1, 0.10, 0.8, 0.60, true, gui ) columnA = guiGridListAddColumn( grid, "ZM hats", 0.85 ) guiGridListSetItemText ( myGridList, row, columnA, "WW1 hat", false, false ) guiGridListSetItemText ( myGridList, row, columnA, "WW2 hat", false, false )
  8. thx, it was a problem on line 27
  9. i made a script on usernames that a gate moves after the certain guy went into COL shape, but every time i leave the col shape i get the objects different rotation... allObjects = { createObject( 974, 2925.599609375, -1328.69921875, 8.25, 0, 0, 279.99755859375), createObject( 974, 2928.8000488281, -1328.1999511719, 14.5, 0, 0, 10.49755859375), createObject( 974, 2926.3000488281, -1328.5999755859, 8.3000001907349, 0, 0, 279.99755859375), createObject( 974, 2925.5, -1328.6999511719, 14.5, 0, 0, 279.99755859375), createObject( 974, 2928.8999023438, -1328.1999511719, 8.3000001907349, 0, 0, 10.497436523438), createObject( 974, 2926.3999023438, -1328.5999755859, 14.5, 0, 0, 279.99755859375), createObject( 974, 2928.1999511719, -1324.9000244141, 14.5, 0, 0, 10.497436523438), createObject( 974, 2928.3000488281, -1324.9000244141, 8.3000001907349, 0, 0, 10.497436523438), createObject( 974, 2929.5, -1331.4000244141, 8.3000001907349, 0, 0, 10.497436523438), createObject( 974, 2929.3999023438, -1331.4000244141, 14.5, 0, 0, 10.497436523438), createObject( 974, 2934.6000976563, -1327, 8.3000001907349, 0, 0, 279.99755859375), createObject( 974, 2934.5, -1327, 14.5, 0, 0, 280.49755859375), createObject( 974, 2928.8999023438, -1328.6999511719, 17.200000762939, 90, 0, 10.497436523438), createObject( 974, 2931.3000488281, -1328.1999511719, 17.200000762939, 90, 0, 10.491943359375), createObject( 974, 2931.1000976563, -1327, 17.200000762939, 90, 0, 10.491943359375), createObject( 974, 2928.6999511719, -1327.5, 17.200000762939, 90, 0, 10.491943359375) } gate1 = createObject( 2909, 2933.8000488281, -1330.5, 12.800000190735, 90, 90, 13.25) gate1_ = createColCuboid( 2933.0871582031, -1332.4675292969, 9.582202911377, 2, 3.5, 2 ) setElementData ( gate1_, "owner", "[ZM]Enjoy" ) addEventHandler ( "onColShapeHit", gate1_, function ( h ) if ( getElementType ( h ) == "player" ) then if ( getElementData ( source, "owner" ) == getPlayerName ( h ) ) then moveObject( gate1, 100, 100, 2933.8000488281, -1330.5, 3 ) end end end ) addEventHandler ( "onColShapeLeave", gate1_, function ( h ) if ( getElementType ( h ) == "player" ) then if ( getElementData ( source, "owner" ) == getPlayerName ( h ) ) then moveObject ( gate1, 100, 2933.8000488281, -1330.5, 12.800000190735 ) end end end ) 2images to proof: http://i.imgur.com/9GBND.png http://i.imgur.com/4OP6H.png i will like every help from everyone for this
  10. manve1

    Help dont work

    Now it started to work, thanx
  11. manve1

    Help dont work

    in the {} bit you forgot "," after 2 objects just letting you know EDIT: it don't move
  12. manve1

    Help dont work

    still doesn't move..
  13. manve1

    Help dont work

    it wont work... its same thing.. nothing is changed, everything is the same writen, i missed out a part which i dont know about it. But still thx for a try
  14. i'm trying to make another script for my server and again it has something wrong with it, debugscript 3 shows no errors, same with console, help me if you can gate = createObject( 980, 2771.3999023438, -2417.8000488281, 15.39999961853, 0, 0, 270 ) createObject( 3749, 2772, -2417.8000488281, 18.299999237061, 0, 0, 90 ) createObject( 2909, 2798, -2430.1999511719, 14.60000038147, 0, 0, 90 ) createObject( 2909, 2797.6000976563, -2405.3000488281, 14.60000038147, 0, 0, 90 ) col = createColRectangle( 2773.0812988281, -2422.6938476563, 2.75, 2 ) function hit() for key, gate in ipairs ( allObjects ) do local origX, origY, origZ = getElementPosition ( gate ) moveObject( gate, 100, 2771.3999023438, -2417.8000488281, 18 ) end end addEventHandler("onColShapeHit", gate, hit) function leave() moveObject( gate, 15000, 2771.3999023438, -2417.8000488281, 15.39999961853) end addEventHandler("onColShapeLeave", gate, leave) EDIT: The gate doesnt move when i hit col, or is something wrong with col shape? please help
  15. manve1

    No Damage

    I get no damage when my bodyguard shots me, or shots others that attacked them... we were standing for 1hour till his ammo run out, but 4of us were still alive with 100% of health, i downloaded this script from community ( https://community.multitheftauto.com/ind ... ls&id=5491 ) and i have added that only admins are allowed to use the function, before i added, i done the test, and i done test after adding the command only for admin. Please help, if you willing to help, please download the resource, and try it yourself, then re-make it if you can and please tell me where the error is, thank you or just bit quicker: client side: http://pastebin.com/xpsGF4dd server side: http://pastebin.com/vCk9Jb32 NOTE: on server side, sorry for the german notes, i didnt make the script, i downloaded from community.
  16. manve1

    Need help-ACL

    can you stop arguing and give me how it should be and should work with? here is debug: http://i.imgur.com/KsJmw.jpg
  17. manve1

    Need help-ACL

    this dont work too and the script is server sided.
  18. Use these functions: createMarker onMarkerHit onMarkerLeave triggerServerEvent triggerClientEvent addEventHandler addEvent getPedOccupiedVehicle And more. if i was u i would make a GUI when you hit a marker. NOTE: to see which function is in which category ( client or server ) go to wiki, or click on LUA ( not all will work when you click on the lua file i gave you )
  19. this is more like bus driver or taxi driver... i try to make a script like this.
  20. manve1

    Need help-ACL

    hey guys, how could i make this script only work for admins? i have tryied using wiki and from other scripts, but it didn't help please help me addCommandHandler("getguard", function(p) if(ablauf[p] == true) then return end ablauf[p] = true local x, y, z = getElementPosition(p) ped[p] = createPed(164, x, y+1, z) setElementData(ped[p], "besitzer", getPlayerName(p)) setElementData(ped[p], "bodyguard", true) giveWeapon(ped[p], 25, 99999, true) setPedStat (ped[p], 72, 999) addEventHandler("onPedWasted", ped[p], function() local ped = source setTimer(destroyElement, 1000, 1, ped) ablauf[p] = false end) end) thanx for any help.
  21. learning MySQL.... easy way... or just paying someone to do it for you.
  22. What do you mean by markerjob? what kinda? like a GUI job? or when you go into a marker you get a GUI? or what? explain more, we might understand what kinda job to script and show you example, now you just sayid "simple markerjob" < = what you mean by that???
×
×
  • Create New...