Chris!i! Posted September 10, 2014 Share Posted September 10, 2014 Hello i was making a walking style script well anyone can help me. GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 546) / 2, (screenH - 229) / 2, 546, 229, "Walking Style", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) GUIEditor.gridlist[2] = guiCreateGridList(9, 26, 365, 193, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[2], "Styles", 0.5) guiGridListAddColumn(GUIEditor.gridlist[2], "ID", 0.5) for i = 1, 24 do guiGridListAddRow(GUIEditor.gridlist[2]) local Default = guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Default", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 0, 2, "0", false, false) local Sneak = guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Sneak", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 1, 2, "69", false, false) local Fat = guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Fat", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 2, 2, "55", false, false) local Muscular = guiGridListSetItemText(GUIEditor.gridlist[2], 3, 1, "Muscular", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 3, 2, "56", false, false) local Man = guiGridListSetItemText(GUIEditor.gridlist[2], 4, 1, "Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 4, 2, "118", false, false) local FatMan = guiGridListSetItemText(GUIEditor.gridlist[2], 5, 1, "Fat Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 5, 2, "124", false, false) local Gang1 = guiGridListSetItemText(GUIEditor.gridlist[2], 6, 1, "Gang One", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 6, 2, "121", false, false) local Gang2 = guiGridListSetItemText(GUIEditor.gridlist[2], 7, 1, "Gang Two", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 7, 2, "122", false, false) local Blind = guiGridListSetItemText(GUIEditor.gridlist[2], 8, 1, "Blind Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 8, 2, "127", false, false) local SWAT = guiGridListSetItemText(GUIEditor.gridlist[2], 9, 1, "S.W.A.T", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 9, 2, "128", false, false) local Hooker = guiGridListSetItemText(GUIEditor.gridlist[2], 10, 1, "Hooker", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 10, 2, "133", false, false) local OldMan = guiGridListSetItemText(GUIEditor.gridlist[2], 11, 1, "Old Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 11, 2, "120", false, false) local SexyWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 12, 1, "Sexy Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 12, 2, "132", false, false) local JoggerMan = guiGridListSetItemText(GUIEditor.gridlist[2], 13, 1, "Jogger Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 13, 2, "136", false, false) local Shuffle = guiGridListSetItemText(GUIEditor.gridlist[2], 14, 1, "Shuffle", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 14, 2, "119", false, false) local Shopper = guiGridListSetItemText(GUIEditor.gridlist[2], 15, 1, "Shopper", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 15, 2, "130", false, false) local BusyWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 16, 1, "Busy Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 16, 2, "131", false, false) local OldFatWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 17, 1, "Old Fat Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 17, 2, "137", false, false) local Drunk = guiGridListSetItemText(GUIEditor.gridlist[2], 18, 1, "Drunk", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 18, 2, "126", false, false) local Woman = guiGridListSetItemText(GUIEditor.gridlist[2], 19, 1, "Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 19, 2, "129", false, false) local JoggerWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 20, 1, "Jogger Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 20, 2, "136", false, false) local Jogger = guiGridListSetItemText(GUIEditor.gridlist[2], 21, 1, "Jogger", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 21, 2, "125", false, false) local DefaultFat = guiGridListSetItemText(GUIEditor.gridlist[2], 22, 1, "Default Fat", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 22, 2, "55", false, false) local DefaultMuscular = guiGridListSetItemText(GUIEditor.gridlist[2], 23, 1, "Default Muscular", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 23, 2, "56", false, false) GUIEditor.button[1] = guiCreateButton(377, 27, 159, 40, "Choose", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF1DFC00") GUIEditor.button[2] = guiCreateButton(378, 97, 158, 40, "Cancel", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFD0000") GUIEditor.label[1] = guiCreateLabel(380, 147, 156, 72, "Welcome to they gym here\n you can edit your walking\nstyle by choosing any style\nfrom the list!", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 156, 254) end end ) addEventHandler("onClientGUIClick",getRootElement(), function ( player ) local player2 = getLocalPlayer() if (source == GUIEditor.button[2]) then guiSetVisible (GUIEditor.window[1],false) showCursor (false) end end ) addEvent ("showGUI", true) function showGUI () if (getLocalPlayer() == source) then guiSetVisible (GUIEditor.window[1],true) showCursor(true) end end addEventHandler ("showGUI", getRootElement(), showGUI) function select () if (guiGridListGetSelectedItem (GUIEditor.gridlist[2])) then local id = guiGridListGetItemText (GUIEditor.gridlist[2], guiGridListGetSelectedItem (GUIEditor.gridlist[2]), 2) if id == Default then setPedWalkingStyle ( player, 69 ) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end end addEventHandler("onClientGUIClick", GUIEditor.button[1], select, false) and ths is server blip1 = createBlip ( 2229.05859375, -1726.1688232422, 13.550597190857, 54) blip2 = createBlip ( -2267, -155, 36, 54) blip3 = createBlip ( 1969, 2296, 17, 54) local Marker = createMarker(758.49481201172, -64.987289428711, 999.800,"cylinder", 1.5, 127, 255, 0, 170) --LV setElementInterior ( Marker, 7 ) local Marker1 = createMarker(773.48370361328, -2.3588185310364, 999.800,"cylinder", 1.5, 127, 255, 255, 170) --LS setElementInterior ( Marker1, 5 ) local Marker2 = createMarker(759.57470703125, -48.2854347229, 999.800,"cylinder", 1.5, 127, 255, 0, 170) --SF setElementInterior ( Marker2, 6 ) function showGUI (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then triggerClientEvent ("showGUI", hitPlayer) end end addEventHandler ("onMarkerHit", resourceRoot, showGUI) /debugscript 3 problem is WARNING: Styles/style.lua(this is Client):119 Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil] Any help ? Link to comment
Anubhav Posted September 10, 2014 Share Posted September 10, 2014 GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 546) / 2, (screenH - 229) / 2, 546, 229, "Walking Style", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) GUIEditor.gridlist[2] = guiCreateGridList(9, 26, 365, 193, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[2], "Styles", 0.5) guiGridListAddColumn(GUIEditor.gridlist[2], "ID", 0.5) for i = 1, 24 do guiGridListAddRow(GUIEditor.gridlist[2]) local Default = guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Default", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 0, 2, "0", false, false) local Sneak = guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Sneak", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 1, 2, "69", false, false) local Fat = guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Fat", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 2, 2, "55", false, false) local Muscular = guiGridListSetItemText(GUIEditor.gridlist[2], 3, 1, "Muscular", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 3, 2, "56", false, false) local Man = guiGridListSetItemText(GUIEditor.gridlist[2], 4, 1, "Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 4, 2, "118", false, false) local FatMan = guiGridListSetItemText(GUIEditor.gridlist[2], 5, 1, "Fat Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 5, 2, "124", false, false) local Gang1 = guiGridListSetItemText(GUIEditor.gridlist[2], 6, 1, "Gang One", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 6, 2, "121", false, false) local Gang2 = guiGridListSetItemText(GUIEditor.gridlist[2], 7, 1, "Gang Two", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 7, 2, "122", false, false) local Blind = guiGridListSetItemText(GUIEditor.gridlist[2], 8, 1, "Blind Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 8, 2, "127", false, false) local SWAT = guiGridListSetItemText(GUIEditor.gridlist[2], 9, 1, "S.W.A.T", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 9, 2, "128", false, false) local Hooker = guiGridListSetItemText(GUIEditor.gridlist[2], 10, 1, "Hooker", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 10, 2, "133", false, false) local OldMan = guiGridListSetItemText(GUIEditor.gridlist[2], 11, 1, "Old Man", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 11, 2, "120", false, false) local SexyWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 12, 1, "Sexy Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 12, 2, "132", false, false) local JoggerMan = guiGridListSetItemText(GUIEditor.gridlist[2], 13, 1, "Jogger Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 13, 2, "136", false, false) local Shuffle = guiGridListSetItemText(GUIEditor.gridlist[2], 14, 1, "Shuffle", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 14, 2, "119", false, false) local Shopper = guiGridListSetItemText(GUIEditor.gridlist[2], 15, 1, "Shopper", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 15, 2, "130", false, false) local BusyWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 16, 1, "Busy Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 16, 2, "131", false, false) local OldFatWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 17, 1, "Old Fat Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 17, 2, "137", false, false) local Drunk = guiGridListSetItemText(GUIEditor.gridlist[2], 18, 1, "Drunk", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 18, 2, "126", false, false) local Woman = guiGridListSetItemText(GUIEditor.gridlist[2], 19, 1, "Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 19, 2, "129", false, false) local JoggerWoman = guiGridListSetItemText(GUIEditor.gridlist[2], 20, 1, "Jogger Woman", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 20, 2, "136", false, false) local Jogger = guiGridListSetItemText(GUIEditor.gridlist[2], 21, 1, "Jogger", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 21, 2, "125", false, false) local DefaultFat = guiGridListSetItemText(GUIEditor.gridlist[2], 22, 1, "Default Fat", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 22, 2, "55", false, false) local DefaultMuscular = guiGridListSetItemText(GUIEditor.gridlist[2], 23, 1, "Default Muscular", false, false) guiGridListSetItemText(GUIEditor.gridlist[2], 23, 2, "56", false, false) GUIEditor.button[1] = guiCreateButton(377, 27, 159, 40, "Choose", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF1DFC00") addEventHandler("onClientGUIClick", GUIEditor.button[1], select, false) GUIEditor.button[2] = guiCreateButton(378, 97, 158, 40, "Cancel", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFD0000") GUIEditor.label[1] = guiCreateLabel(380, 147, 156, 72, "Welcome to they gym here\n you can edit your walking\nstyle by choosing any style\nfrom the list!", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 156, 254) end end ) addEventHandler("onClientGUIClick",getRootElement(), function ( player ) local player2 = getLocalPlayer() if (source == GUIEditor.button[2]) then guiSetVisible (GUIEditor.window[1],false) showCursor (false) end end ) addEvent ("showGUI", true) function showGUI () if (getLocalPlayer() == source) then guiSetVisible (GUIEditor.window[1],true) showCursor(true) end end addEventHandler ("showGUI", getRootElement(), showGUI) function select () if (guiGridListGetSelectedItem (GUIEditor.gridlist[2])) then local id = guiGridListGetItemText (GUIEditor.gridlist[2], guiGridListGetSelectedItem (GUIEditor.gridlist[2]), 2) setPedWalkingStyle ( localPlayer, id ) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end Link to comment
Moderators IIYAMA Posted September 10, 2014 Moderators Share Posted September 10, 2014 (edited) Requires an integer. setPedWalkingStyle ( localPlayer, tonumber(id) or 0 ) @Chris!i! What is that loop all about? Doesn't make sense. Edited September 10, 2014 by Guest Link to comment
Anubhav Posted September 10, 2014 Share Posted September 10, 2014 Requires an integer. setPedWalkingStyle ( localPlayer, tonumber(id) or 0 ) Without it worked fine for me. Tested Link to comment
Chris!i! Posted September 10, 2014 Author Share Posted September 10, 2014 .-. i need it every row should have his own Style ID Link to comment
Anubhav Posted September 10, 2014 Share Posted September 10, 2014 .-. i need it every row should have his own Style ID are you mad? Its doing that. See the difference between sneak and default muscular. Link to comment
Moderators IIYAMA Posted September 10, 2014 Moderators Share Posted September 10, 2014 .-. i need it every row should have his own Style ID I recommend this: for i = 1, 24 do guiGridListAddRow(GUIEditor.gridlist[2]) end -- rest of the code..... Link to comment
Chris!i! Posted September 10, 2014 Author Share Posted September 10, 2014 .-. i need it every row should have his own Style ID I recommend this: for i = 1, 24 do guiGridListAddRow(GUIEditor.gridlist[2]) end -- rest of the code..... didnt worked Link to comment
Moderators IIYAMA Posted September 10, 2014 Moderators Share Posted September 10, 2014 or you didn't remove that last end. or you have to add a row every time you set an item text, so you have to change the code. 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