Jump to content

Spawn


Xperia

Recommended Posts

Ahora, tengo esto:

  
        ventana = guiCreateWindow(1086,15,269,635,"Spawn",false) 
        guiSetAlpha(ventana,0.94999998807907) 
        guiWindowSetMovable(ventana,false) 
        guiWindowSetSizable(ventana,false) 
        grid_skins = guiCreateGridList(13,482,244,144,false,ventana) 
        guiGridListSetSelectionMode(grid_skins,2) 
  
        guiGridListAddColumn(grid_skins," ",0.95) 
  
        rowSkin1 = guiGridListAddRow(grid_skins) 
        rowSkin2 = guiGridListAddRow(grid_skins) 
  
        grid_city = guiCreateGridList(13,51,244,188,false,ventana) 
        guiGridListSetSelectionMode(grid_city,2) 
  
        columnCity = guiGridListAddColumn(grid_city,"San Andreas",0.95) 
  
        rowCitySF = guiGridListAddRow(grid_city) 
        guiGridListSetItemText ( grid_city, rowCitySF, columnCity, "San Francisco", false, false ) 
        rowCityLS = guiGridListAddRow(grid_city) 
        guiGridListSetItemText ( grid_city, rowCityLS, columnCity, "Los Santos", false, false ) 
  
        grid_groups = guiCreateGridList(13,269,244,188,false,ventana) 
        guiGridListSetSelectionMode(grid_groups,2) 
  
        columnGroups = guiGridListAddColumn(grid_groups," ",0.95) 
         
     
        groups_name = guiCreateLabel(112,246,88,23,"Groups",false,ventana) 
        guiSetFont(groups_name,"default-bold-small") 
        skins_name = guiCreateLabel(118,461,88,23,"Skins",false,ventana) 
        guiSetFont(skins_name,"default-bold-small") 
        city_name = guiCreateLabel(117,30,88,23,"City",false,ventana) 
        guiSetFont(city_name,"default-bold-small") 
  
        spawn_button = guiCreateButton(1088,654,266,99,"Spawn",false) 
        guiSetFont(spawn_button,"default-bold-small") 
  
        info = guiCreateMemo(375,653,653,101,"",false) 
        guiMemoSetReadOnly(info,true) 
         
        guiSetVisible ( ventana , true ) 
        showCursor ( true ) 
         
function name1() 
if rowCitySF then 
        rowGroupsPolice = guiGridListAddRow(grid_groups) 
        guiGridListSetItemText ( grid_groups, rowGroupsPolice, columnGroups, "Police", false, false ) 
end      
end 
addEventHandler("onClientGUIClick",getRootElement(),name1) 

El error es que al hacer click en "cualquier sitio del GUI", crea el row "Police" y se crea tantas veces como clicks des, y yo solo quiero que lo cree 1 vez, y solo al pulsar "San Francisco".

Link to comment
function name1 ( ) 
    if ( rowCitySF ) then 
        local row, col = guiGridListGetSelectedItem ( source ) 
        if ( row and col and row ~= -1 and col ~= -1 ) then 
            local cityName = guiGridListGetItemText ( source, row, 1 ) 
            if ( cityName == "San Francisco" ) then 
                guiGridListClear ( grid_groups ) 
                rowGroupsPolice = guiGridListAddRow ( grid_groups ) 
                guiGridListSetItemText ( grid_groups, rowGroupsPolice, columnGroups, "Police", false, false ) 
            end 
        end 
    end 
end 
addEventHandler ( "onClientGUIClick", grid_city, name1, false ) 

Link to comment

Ahora cuando estoy con otro user en el server, y yo spawneo, el no puede porque no le aparece el panel.

x, y = guiGetScreenSize() 
  
  
        ventana = guiCreateWindow(x*0.7950219619326501,y*0.01953125,x*0.1969253294289898,y*0.8268229166666667,"Spawn",false) 
        guiSetAlpha(ventana,0.94999998807907) 
        guiWindowSetMovable(ventana,false) 
        guiWindowSetSizable(ventana,false) 
         
        grid_skins = guiCreateGridList(x*0.0095168374816984,y*0.6276041666666667,x*0.1786237188872621,y*0.1875,false,ventana) 
        guiGridListSetSelectionMode(grid_skins,2) 
  
        columnSkins = guiGridListAddColumn(grid_skins," ",0.95) 
         
        grid_city = guiCreateGridList(x*0.0095168374816984,y*0.06640625,x*0.1786237188872621,y*0.2447916666666667,false,ventana) 
        guiGridListSetSelectionMode(grid_city,2) 
  
        columnCity = guiGridListAddColumn(grid_city,"San Andreas",0.95) 
  
        rowCitySF = guiGridListAddRow(grid_city) 
        guiGridListSetItemText ( grid_city, rowCitySF, columnCity, "San Francisco", false, false ) 
        rowCityLS = guiGridListAddRow(grid_city) 
        guiGridListSetItemText ( grid_city, rowCityLS, columnCity, "Los Santos", false, false ) 
         
        grid_groups = guiCreateGridList(x*0.0095168374816984,y*0.3502604166666667,x*0.1786237188872621,y*0.2447916666666667,false,ventana) 
        guiGridListSetSelectionMode(grid_groups,2) 
  
        columnGroups = guiGridListAddColumn(grid_groups," ",0.95) 
         

Edited by Guest
Link to comment
function test(player) 
guiSetVisible ( ventana , false ) 
guiSetVisible ( spawn_button , false ) 
guiSetVisible ( info , false ) 
showCursor ( false ) 
end 
addEventHandler("onClientPlayerSpawn",localPlayer,test) 
  
  
  
function test2(localPlayer) 
guiSetVisible ( ventana , true ) 
guiSetVisible ( spawn_button , true ) 
guiSetVisible ( info , true ) 
showCursor ( true ) 
end 
addEventHandler("onClientPlayerWasted",localPlayer,test2) 

Link to comment
  • Recently Browsing   0 members

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