Jump to content

Another Problem sorry


Chris!i!

Recommended Posts

  
 local player = getLocalPlayer () 
  
font = guiCreateFont( "font.TTF", 14 ) 
marker1 = createMarker ( 759.08984375, -59.798828125, 999.7802124023, "cylinder", 1.5, 100, 0, 0, 255 ) 
marker2 = createMarker ( 773.375, 5.2412109375, 999.7802124023, "cylinder", 1.5, 100, 0, 0, 255 ) 
marker3 = createMarker ( 756.443359375, -48.0576171875, 999.7802124023, "cylinder", 1.5, 100, 0, 0, 255 ) 
blip1 = createBlip( 1968.8681640625, 2295.1806640625, 54, 54 ) 
blip2 = createBlip( -2270.4599609375, -155.95703125, 24, 54 ) 
blip3 = createBlip( 2229.6298828125, -1721.6298828125, 44, 54 ) 
setElementInterior(marker1, 7) 
setElementInterior(marker2, 5) 
setElementInterior(marker3, 6) 
  
  
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {}, 
    memo = {} 
    --scrollbar = {} 
} 
  
local screenW, screenH = guiGetScreenSize() 
GUIEditor.window[1] = guiCreateWindow((screenW - 678) / 2, (screenH - 695) / 2, 678, 695, "Set Your Walking Style", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 659, 355, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Walking Styles", 0.9) 
local armed = guiGridListAddRow(GUIEditor.gridlist[1], "Armed") 
local blind = guiGridListAddRow(GUIEditor.gridlist[1], "Blind Man") 
local busy = guiGridListAddRow(GUIEditor.gridlist[1], "Busy Women") 
local default = guiGridListAddRow(GUIEditor.gridlist[1], "Default") 
local drunk = guiGridListAddRow(GUIEditor.gridlist[1], "Drunk Man") 
local fat = guiGridListAddRow(GUIEditor.gridlist[1], "Fat Man") 
local fatw = guiGridListAddRow(GUIEditor.gridlist[1], "Fat Woman") 
local g1 = guiGridListAddRow(GUIEditor.gridlist[1], "Gang 1") 
local g2 = guiGridListAddRow(GUIEditor.gridlist[1], "Gang 2") 
local jp = guiGridListAddRow(GUIEditor.gridlist[1], "Jetpack") 
local other = guiGridListAddRow(GUIEditor.gridlist[1], "Sneak") 
local jogg = guiGridListAddRow(GUIEditor.gridlist[1], "Jogger") 
local men = guiGridListAddRow(GUIEditor.gridlist[1], "Men") 
local ofm = guiGridListAddRow(GUIEditor.gridlist[1], "Old FatMan") 
local ofw = guiGridListAddRow(GUIEditor.gridlist[1], "Old FatWomen") 
local pyr = guiGridListAddRow(GUIEditor.gridlist[1], "Player") 
local pyr2 = guiGridListAddRow(GUIEditor.gridlist[1], "Player 2") 
local pro = guiGridListAddRow(GUIEditor.gridlist[1], "Pro") 
local swt = guiGridListAddRow(GUIEditor.gridlist[1], "SWAT") 
local swmn = guiGridListAddRow(GUIEditor.gridlist[1], "Sexy Women") 
local shp = guiGridListAddRow(GUIEditor.gridlist[1], "Shopping") 
local shf = guiGridListAddRow(GUIEditor.gridlist[1], "Shuffle") 
local wmn = guiGridListAddRow(GUIEditor.gridlist[1], "Woman") 
  
  
  
--[[guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Armed", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Blind Man", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "Busy Woman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "Default", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "Drunk Man", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "Fat Man", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "Fat Woman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "Gang 1", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 8, 1, "Gang 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 9, 1, "Jetpack", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 10, 1, "Jogger", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 11, 1, "Men", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 12, 1, "Old FatMan", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 13, 1, "Old FatWoman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 14, 1, "Player", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 15, 1, "Player 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 16, 1, "Pro", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 17, 1, "SWAT", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 18, 1, "Sexy Woman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 19, 1, "Shopping", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 20, 1, "Shuffle", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 21, 1, "Sneak", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 22, 1, "Woman", false, false) 
]] 
guiSetAlpha(GUIEditor.gridlist[1], 0.75) 
  
GUIEditor.memo[1] = guiCreateMemo(0, 389, 659, 200, "Walking style, choose one from the list and click accept, here you go you got it!\nThere's About 23 Walking Styles, choose one and ROCK!\nEnjoy!\nMade by Chris!i!", false, GUIEditor.window[1]) 
  
GUIEditor.button[1] = guiCreateButton(9, 599, 331, 86, "ACCEPT", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[1], font) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
GUIEditor.button[2] = guiCreateButton(342, 599, 326, 86, "CLOSE", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[2], font) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
guiMemoSetReadOnly ( GUIEditor.memo[1], true ) 
guiSetFont(GUIEditor.gridlist[1], font) 
         
         
     function setGUIVisible(hitElement) 
            if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
                  if not guiGetVisible(GUIEditor.window[1]) then 
                       guiSetVisible(GUIEditor.window[1], true) 
                       showCursor(true) 
                  end 
            end 
     end 
  
        addEventHandler ( "onClientMarkerHit", marker1, setGUIVisible ) 
        addEventHandler ( "onClientMarkerHit", marker2, setGUIVisible ) 
        addEventHandler ( "onClientMarkerHit", marker3, setGUIVisible ) 
         
         
        function closeGUI () 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
        end 
        addEventHandler ( "onClientGUIClick", GUIEditor.button[2], closeGUI ) 
         
        function dontAppearOnStart () 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor (false) 
        end 
        addEventHandler ( "onClientResourceStart", getRootElement(), dontAppearOnStart ) 
         
  
function select () 
local id = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) 
if id == armed then 
setPedWalkingStyle ( player, 60 ) 
elseif id == blind then  
setPedWalkingStyle ( player, 127 ) 
elseif id == busy then  
setPedWalkingStyle ( player, 69 ) 
elseif id == default then  
setPedWalkingStyle ( player, 0 ) 
elseif id == drunk then  
setPedWalkingStyle ( player, 126 ) 
elseif id == fat then  
setPedWalkingStyle ( player, 124 ) 
elseif id == fatw then  
setPedWalkingStyle ( player, 135 ) 
elseif id == g1 then  
setPedWalkingStyle ( player, 121 ) 
elseif id == g2 then  
setPedWalkingStyle ( player, 122 ) 
elseif id == jp then  
setPedWalkingStyle ( player, 70 ) 
elseif id == other then  
setPedWalkingStyle ( player, 69 ) 
elseif id == jogg then  
setPedWalkingStyle ( player, 125 ) 
elseif id == men then  
setPedWalkingStyle ( player, 118 ) 
elseif id == ofm then  
setPedWalkingStyle ( player, 123 ) 
elseif id == ofw then  
setPedWalkingStyle ( player, 137 ) 
elseif id == pyr then  
setPedWalkingStyle ( player, 54 ) 
end 
end 
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], select, false ) 

Again, whats wrong when i putted 1 Row in the gridlist it worked, but when i putted all of them in the gridlist it doesnt even give 1 error, and i cant see anytihng the gridlist! please help

Link to comment
  
 local player = getLocalPlayer () 
  
font = guiCreateFont( "font.TTF", 14 ) 
marker1 = createMarker ( 759.08984375, -59.798828125, 999.7802124023, "cylinder", 1.5, 100, 0, 0, 255 ) 
marker2 = createMarker ( 773.375, 5.2412109375, 999.7802124023, "cylinder", 1.5, 100, 0, 0, 255 ) 
marker3 = createMarker ( 756.443359375, -48.0576171875, 999.7802124023, "cylinder", 1.5, 100, 0, 0, 255 ) 
blip1 = createBlip( 1968.8681640625, 2295.1806640625, 54, 54 ) 
blip2 = createBlip( -2270.4599609375, -155.95703125, 24, 54 ) 
blip3 = createBlip( 2229.6298828125, -1721.6298828125, 44, 54 ) 
setElementInterior(marker1, 7) 
setElementInterior(marker2, 5) 
setElementInterior(marker3, 6) 
  
  
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {}, 
    memo = {} 
    --scrollbar = {} 
} 
  
local screenW, screenH = guiGetScreenSize() 
GUIEditor.window[1] = guiCreateWindow((screenW - 678) / 2, (screenH - 695) / 2, 678, 695, "Set Your Walking Style", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 659, 355, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Walking Styles", 0.9) 
local armed = guiGridListAddRow(GUIEditor.gridlist[1], "Armed") 
local blind = guiGridListAddRow(GUIEditor.gridlist[1], "Blind Man") 
local busy = guiGridListAddRow(GUIEditor.gridlist[1], "Busy Women") 
local default = guiGridListAddRow(GUIEditor.gridlist[1], "Default") 
local drunk = guiGridListAddRow(GUIEditor.gridlist[1], "Drunk Man") 
local fat = guiGridListAddRow(GUIEditor.gridlist[1], "Fat Man") 
local fatw = guiGridListAddRow(GUIEditor.gridlist[1], "Fat Woman") 
local g1 = guiGridListAddRow(GUIEditor.gridlist[1], "Gang 1") 
local g2 = guiGridListAddRow(GUIEditor.gridlist[1], "Gang 2") 
local jp = guiGridListAddRow(GUIEditor.gridlist[1], "Jetpack") 
local other = guiGridListAddRow(GUIEditor.gridlist[1], "Sneak") 
local jogg = guiGridListAddRow(GUIEditor.gridlist[1], "Jogger") 
local men = guiGridListAddRow(GUIEditor.gridlist[1], "Men") 
local ofm = guiGridListAddRow(GUIEditor.gridlist[1], "Old FatMan") 
local ofw = guiGridListAddRow(GUIEditor.gridlist[1], "Old FatWomen") 
local pyr = guiGridListAddRow(GUIEditor.gridlist[1], "Player") 
local pyr2 = guiGridListAddRow(GUIEditor.gridlist[1], "Player 2") 
local pro = guiGridListAddRow(GUIEditor.gridlist[1], "Pro") 
local swt = guiGridListAddRow(GUIEditor.gridlist[1], "SWAT") 
local swmn = guiGridListAddRow(GUIEditor.gridlist[1], "Sexy Women") 
local shp = guiGridListAddRow(GUIEditor.gridlist[1], "Shopping") 
local shf = guiGridListAddRow(GUIEditor.gridlist[1], "Shuffle") 
local wmn = guiGridListAddRow(GUIEditor.gridlist[1], "Woman") 
  
  
  
--[[guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Armed", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Blind Man", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "Busy Woman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "Default", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "Drunk Man", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "Fat Man", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "Fat Woman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "Gang 1", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 8, 1, "Gang 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 9, 1, "Jetpack", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 10, 1, "Jogger", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 11, 1, "Men", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 12, 1, "Old FatMan", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 13, 1, "Old FatWoman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 14, 1, "Player", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 15, 1, "Player 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 16, 1, "Pro", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 17, 1, "SWAT", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 18, 1, "Sexy Woman", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 19, 1, "Shopping", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 20, 1, "Shuffle", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 21, 1, "Sneak", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 22, 1, "Woman", false, false) 
]] 
guiSetAlpha(GUIEditor.gridlist[1], 0.75) 
  
GUIEditor.memo[1] = guiCreateMemo(0, 389, 659, 200, "Walking style, choose one from the list and click accept, here you go you got it!\nThere's About 23 Walking Styles, choose one and ROCK!\nEnjoy!\nMade by Chris!i!", false, GUIEditor.window[1]) 
  
GUIEditor.button[1] = guiCreateButton(9, 599, 331, 86, "ACCEPT", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[1], font) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
GUIEditor.button[2] = guiCreateButton(342, 599, 326, 86, "CLOSE", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[2], font) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
guiMemoSetReadOnly ( GUIEditor.memo[1], true ) 
guiSetFont(GUIEditor.gridlist[1], font) 
        
        
     function setGUIVisible(hitElement) 
            if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
                  if not guiGetVisible(GUIEditor.window[1]) then 
                       guiSetVisible(GUIEditor.window[1], true) 
                       showCursor(true) 
                  end 
            end 
     end 
  
        addEventHandler ( "onClientMarkerHit", marker1, setGUIVisible ) 
        addEventHandler ( "onClientMarkerHit", marker2, setGUIVisible ) 
        addEventHandler ( "onClientMarkerHit", marker3, setGUIVisible ) 
        
        
        function closeGUI () 
        if source == GUIEditor.button[2] then 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor ( false ) 
        end 
        end 
        addEventHandler ( "onClientGUIClick", GUIEditor.button[2], closeGUI ) 
        
        function dontAppearOnStart () 
        guiSetVisible ( GUIEditor.window[1], false ) 
        showCursor (false) 
        end 
        addEventHandler ( "onClientResourceStart", getRootElement(), dontAppearOnStart ) 
        
  
function selectGridList () 
local id =  guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
    if id == "Armed" then 
        setPedWalkingStyle ( player, 60 ) 
    elseif id == "Blind Man" then 
        setPedWalkingStyle ( player, 127 ) 
    elseif id == "Busy Women" then 
        setPedWalkingStyle ( player, 69 ) 
    elseif id == "Default" then 
        setPedWalkingStyle ( player, 0 ) 
    elseif id == "Drunk Man" then 
        setPedWalkingStyle ( player, 126 ) 
    elseif id == "Fat Man" then 
        setPedWalkingStyle ( player, 124 ) 
    elseif id == "Fat Woman" then 
        setPedWalkingStyle ( player, 135 ) 
    elseif id == "Gang 1" then 
        setPedWalkingStyle ( player, 121 ) 
    elseif id == "Gang 2" then 
        setPedWalkingStyle ( player, 122 ) 
    elseif id == "Jetpack" then 
        setPedWalkingStyle ( player, 70 ) 
    elseif id == "Sneak" then 
        setPedWalkingStyle ( player, 69 ) 
    elseif id == "Jogger" then 
        setPedWalkingStyle ( player, 125 ) 
    elseif id == "Men" then 
        setPedWalkingStyle ( player, 118 ) 
    elseif id == "Old FatMan" then 
        setPedWalkingStyle ( player, 123 ) 
    elseif id == "Old FatWomen" then 
        setPedWalkingStyle ( player, 137 ) 
    elseif id == "Player" then 
        setPedWalkingStyle ( player, 54 ) 
    end 
end 
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], selectGridList, false ) 

Link to comment

seems like you not visiting the wiki. guiGridListAddRow got only one arg which is the gui element. and one more thing!

ATTENTION: Without guiGridListSetItemText there is no row added to the grid. Look at the example, first you give the row a name with row = guiGridListAddRow ( playerList ), and then you use guiGridListSetItemText.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...