Stranger Posted November 6, 2013 Share Posted November 6, 2013 hello guys there is a problem in this code: function() if (source == Select5) then if isPedOnGround ( localPlayer ) then local row9, col9 = guiGridListGetSelectedItem(AnimationGRID) local SSS9 = guiGridListGetItemText(AnimationGRID, row9, col9) if (SSS9) then if (SSS9 == "dance 1") then triggerServerEvent("dance", localPlayer) elseif (SSS9 == "dance 2") then triggerServerEvent("dance2", localPlayer) elseif (SSS9 == "dance 3") then triggerServerEvent("dance3", localPlayer) elseif (SSS9 == "dance 4") then triggerServerEvent("dance4", localPlayer) elseif (SSS9 == "dance 5") then triggerServerEvent("dance5", localPlayer) elseif (SSS9 == "dance 6") then triggerServerEvent("dance6", localPlayer) elseif (SSS9 == "STOP") then triggerServerEvent("dance7", localPlayer) elseif (SSS9 == "Sit 1") then triggerServerEvent("Sit1", localPlayer) elseif (SSS9 == "Sit 2") then triggerServerEvent("Sit2", localPlayer) elseif (SSS9 == "Sit 3") then triggerServerEvent("Sit3", localPlayer) elseif (SSS9 == "Sit 4") then triggerServerEvent("Sit4", localPlayer) end else outputChatBox("You're Not On The Ground", 255, 255, 0) end end end end ) that when i select some thing in the gridlist i should click one time right ? but no i click twice to make it work, i want it one time, i try but nothing happend. Link to comment
Castillo Posted November 6, 2013 Share Posted November 6, 2013 What event are you using? Link to comment
Stranger Posted November 6, 2013 Author Share Posted November 6, 2013 'onClientGUIClick' Link to comment
Castillo Posted November 6, 2013 Share Posted November 6, 2013 So, you attached the event to the grid list? Link to comment
xXMADEXx Posted November 6, 2013 Share Posted November 6, 2013 Instead of having all differant events, i'd recommend having something like this: function fN ( ) if ( source == Select5 and isPedOnGround ( localPlayer ) ) then local row, col = guiGridListGetSelectedItem ( AnimationGRID ) if ( row ~= -1 and col ~= 0 ) then local t = guiGridListGetItemText ( row, 1 ) local t2 = string.lower ( t:gsub ( " ", "" ) ) triggerServerEvent ( "onClientChangeAnimation", localPlayer, t2 ) end end end Link to comment
WASSIm. Posted November 6, 2013 Share Posted November 6, 2013 function () if (source == Select5) then if isPedOnGround ( localPlayer ) then local row9, col9 = guiGridListGetSelectedItem(AnimationGRID) local SSS9 = guiGridListGetItemText(AnimationGRID, row9, col9) if (SSS9) then if (SSS9 == "dance 1") then triggerServerEvent("dance", localPlayer) elseif (SSS9 == "dance 2") then triggerServerEvent("dance2", localPlayer) elseif (SSS9 == "dance 3") then triggerServerEvent("dance3", localPlayer) elseif (SSS9 == "dance 4") then triggerServerEvent("dance4", localPlayer) elseif (SSS9 == "dance 5") then triggerServerEvent("dance5", localPlayer) elseif (SSS9 == "dance 6") then triggerServerEvent("dance6", localPlayer) elseif (SSS9 == "STOP") then triggerServerEvent("dance7", localPlayer) elseif (SSS9 == "Sit 1") then triggerServerEvent("Sit1", localPlayer) elseif (SSS9 == "Sit 2") then triggerServerEvent("Sit2", localPlayer) elseif (SSS9 == "Sit 3") then triggerServerEvent("Sit3", localPlayer) elseif (SSS9 == "Sit 4") then triggerServerEvent("Sit4", localPlayer) end end else outputChatBox("You're Not On The Ground", 255, 255, 0) end end end ) Link to comment
Stranger Posted November 6, 2013 Author Share Posted November 6, 2013 the problem was not in the client sid, it was in the server sid and i know what is the problem and fix it thank you guys . 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