-
Posts
93 -
Joined
-
Last visited
Everything posted by Cocodrilo
-
do not work i start the script and show PANEL2 keeping always but without buttons and when i kill myself only show the cursor.. ( buttons never appeared ) u.u
-
how i add setTimer at show a GUI when aPlayerWasted? would be ... setTimer ( souce, 5000, 1 ) what arguments should i to add and where?? for example : function ondead() if (source == getLocalPlayer()) then if (not isCursorShowing()) then showCursor(true) end GUIEditor = { button = {}, window = {} } PANEL2 = guiCreateWindow(201, 186, 394, 172, "", false) guiWindowSetSizable(GUIEditor.window[1], false) JUGAR = guiCreateButton(32, 45, 150, 90, "Jugar con el mismo personaje", false, PANEL2) guiSetFont(GUIEditor.button[1], "default-bold-small") REGRESAR = guiCreateButton(211, 45, 150, 90, "Regresar al Menú", false, PANEL2) guiSetFont(GUIEditor.button[2], "default-bold-small") addEventHandler("onClientGUIClick", JUGAR, jugarrr) addEventHandler("onClientGUIClick", REGRESAR, regresarrr) end end addEventHandler("onClientPlayerWasted", getRootElement(), ondead) addEvent("onClientPlayerWasted", getRootElement(), ondead)
-
Button = guiCreateButton(30,340,113,46,"choose",false); Pic = guiCreateStaticImage(230,30,134,289,"1.png",false); local load = load addEventHandler("onClientGUIClick",Button, function ( ) if not ( load ) then guiStaticImageLoadImage ( Pic, "1.png" ); load = not load; else guiStaticImageLoadImage ( Pic, "2.png" ); load = not load; end; end,false ); @Mr.Pres[T]ege @TheBesti took this code and works, Thank you su much !!
-
Works!! but if i want to add another one third image.. how to change the second image to the third?
-
I added this at end but doesn't work what's wrong? function gob( ) guiSetVisible( IMAGENRICK, true ) guiSetVisible( IMAGENGOBERNADOR, false ) end addEventHandler("onClientGUIClick", BOTONRIGHT , gob, false)
-
hi all, i would like to know how to make when i click the botton change the StaticImage ... ( I just want to change it for another one in the same position ) .. another one image : IMAGENGOBERNADOR = guiCreateStaticImage(225, 242, 208, 219, "mono2.png", false, PANEL) GUIEditor = { label = {} } if showw == false then local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 661, 528 local left = (screenWidth-windowWidth)/2 local top = (screenHeight-windowHeight)/2 PANEL = guiCreateWindow(left,top,windowWidth,windowHeight, "", false) guiWindowSetSizable(PANEL, false) BANNER = guiCreateStaticImage(9, 18, 642, 163, "banner.png", false, PANEL) IMAGENRICK = guiCreateStaticImage(225, 242, 208, 219, "mono.png", false, PANEL) GUIEditor.label[1] = guiCreateLabel(260, 208, 163, 34, "Selecciona un Personaje", false, PANEL) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 173, 244, 98) BOTONLEFT = guiCreateButton(190, 350, 26, 23, "", false, PANEL) guiSetAlpha(BOTONLEFT, 0.20) BOTONRIGHT = guiCreateButton(440, 350, 26, 23, "", false, PANEL) guiSetAlpha(BOTONRIGHT, 0.20) BOTONIMAGEN = guiCreateButton(225, 242, 208, 219, "", false, PANEL) guiSetAlpha(BOTONIMAGEN, 0.20) showw = false showCursor(true) end
-
What is wrong? function killReward (totalAmmo, killer, killerweapon, bodypart, stealth) local accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("VIP")) then if (killer) and (killer ~= source) then givePlayerMoney (killer, 1000) end end end addEventHandler ("onZombieWasted", getRootElement(), killReward)
-
works !! Thank you so much!!
-
hi all.. i would like add a column at scoreboard by Skin. I try with this.. what is wrong? function ocupacion(thePlayer) theSkinID = getElementModel (source) if (theSkinID == 280) then setElementData ( thePlayer, "Policia", true) end end call(getResourceFromName("scoreboard"), "scoreboardAddColumn", "Ocupacion", root, 100) addEventHandler ("onPlayerSpawn", getRootElement(), ocupacion)
-
Wow!! que pequeño detalle pero ahora lo conosco gracias a ti, muchisimas gracias en verdad
-
done!! Really thank you
-
I have a problem with my teleports GUI. The GUI appears when i join to the server and when I hit a maker. I just wish that the GUI appears when I hit the marker (onClientMarkerHit), not when I join to the server(onClientPlayerJoin) can anyone help me? Client-side ---------------- ORDEN: AMULS, LS, TERRORISTAS, AMULV, QUEBRADOS, COMANDANCIA, HOSPITAL, PLAZITA -------------- local marker = createMarker( 1331.9000244141, -1270.5999755859, 12.3999999, "Cylinder", 2, 143, 7, 49, 255) local marker1 = createMarker( 639.90002441406, -1229.8000488281, 16.89999961853, "Cylinder", 2, 143, 7, 49, 255) local marker2 = createMarker( 2558.5, 1902.5999755859, 10, "Cylinder", 2, 143, 7, 49, 255) local marker3 = createMarker( 773.59997558594, 1884.5999755859, 3.7000000476837, "Cylinder", 2, 143, 7, 49, 255) local marker4 = createMarker( -1314, 2704.3999023438, 48.900001525879, "Cylinder", 2, 143, 7, 49, 255) local marker5 = createMarker( -1487.9000244141, 663.59997558594, 6.199999, "Cylinder", 2, 143, 7, 49, 255) local marker6 = createMarker( -2594.8000488281, 583.20001220703, 13.39999961853, "Cylinder", 2, 143, 7, 49, 255) local marker7 = createMarker( -2677.3999023438, 400.29998779297, 3.4000000953674, "Cylinder", 2, 143, 7, 49, 255) GUIEditor = { label = {}, staticimage = {} } PANEL = guiCreateWindow(119, 69, 571, 476, "", false) guiWindowSetSizable(PANEL, false) guiSetAlpha(PANEL, 0.87) IMAGEN = guiCreateStaticImage(9, 10, 553, 455, "imagen.png", false, PANEL) PLAZITA = guiCreateButton(40, 92, 136, 82, "San Fierro", false, IMAGEN) guiSetAlpha(PLAZITA, 0.30) guiSetFont(PLAZITA, "default-small") AMU2 = guiCreateButton(376, 90, 139, 84, "Ammu-Nation LV", false, IMAGEN) guiSetAlpha(AMU2, 0.30) guiSetFont(AMU2, "default-small") TERRORISTAS = guiCreateButton(205, 90, 140, 84, "Base Terroristas", false, IMAGEN) guiSetAlpha(TERRORISTAS, 0.30) guiSetFont(TERRORISTAS, "default-small") QUEBRADOS = guiCreateButton(39, 204, 137, 82, "The Quebrados", false, IMAGEN) guiSetAlpha(QUEBRADOS, 0.30) guiSetFont(QUEBRADOS, "default-small") AMU1 = guiCreateButton(204, 203, 141, 83, "Ammu-Nation LS", false, IMAGEN) guiSetAlpha(AMU1, 0.30) guiSetFont(AMU1, "default-small") POLICE = guiCreateButton(376, 204, 139, 82, "Comandancia SF", false, IMAGEN) guiSetAlpha(POLICE, 0.30) guiSetFont(POLICE, "default-small") SANTOS = guiCreateButton(38, 316, 138, 89, "Los Santos", false, IMAGEN) guiSetAlpha(SANTOS, 0.30) guiSetFont(SANTOS, "default-small") HOSPITAL = guiCreateButton(206, 319, 139, 81, "Hospital SF", false, IMAGEN) guiSetAlpha(HOSPITAL, 0.30) guiSetFont(HOSPITAL, "default-small") CANCELAR = guiCreateButton(366, 304, 172, 131, "", false, IMAGEN) guiSetAlpha(CANCELAR, 0.00) function teleport(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(PANEL) then guiSetVisible(PANEL, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, teleport) addEventHandler("onClientMarkerHit", marker1, teleport) addEventHandler("onClientMarkerHit", marker2, teleport) addEventHandler("onClientMarkerHit", marker3, teleport) addEventHandler("onClientMarkerHit", marker4, teleport) addEventHandler("onClientMarkerHit", marker5, teleport) addEventHandler("onClientMarkerHit", marker6, teleport) addEventHandler("onClientMarkerHit", marker7, teleport) function PLAZITAA () triggerServerEvent ( "onGreeting", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", PLAZITA , PLAZITAA, false) function AMU22 () triggerServerEvent ( "onGreeting1", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", AMU2 , AMU22, false) function HOSPITALL () triggerServerEvent ( "onGreeting2", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", HOSPITAL , HOSPITALL, false) function AMU11 () triggerServerEvent ( "onGreeting3", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", AMU1 , AMU11, false) function TERRORISTASS () triggerServerEvent ( "onGreeting4", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", TERRORISTAS , TERRORISTASS, false) function QUEBRADOSS () triggerServerEvent ( "onGreeting5", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", QUEBRADOS , QUEBRADOSS, false) function POLICEE () triggerServerEvent ( "onGreeting6", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", POLICE , POLICEE, false) function SANTOSS () triggerServerEvent ( "onGreeting7", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", SANTOS , SANTOSS, false) function CANCELARR () guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", CANCELAR , CANCELARR, false)
-
Recien estoy empezando a comprender esto de las funciones y me fui de lleno a meterme con los guis. Y este es mi primer gui de teleports AL TOCAR UN MAKER pero tengo el problema de que cuando entro al server me aparece la ventana del gui al instante.. Y al tocar el maker tambien. Yo solo quiero que me aparesca el GUI al tocar el maker y no cuando entro (onPlayerJoin) alguien me puede ayudar? aca pongo el client : ---------------- ORDEN: AMULS, LS, TERRORISTAS, AMULV, QUEBRADOS, COMANDANCIA, HOSPITAL, PLAZITA -------------- local marker = createMarker( 1331.9000244141, -1270.5999755859, 12.3999999, "Cylinder", 2, 143, 7, 49, 255) local marker1 = createMarker( 639.90002441406, -1229.8000488281, 16.89999961853, "Cylinder", 2, 143, 7, 49, 255) local marker2 = createMarker( 2558.5, 1902.5999755859, 10, "Cylinder", 2, 143, 7, 49, 255) local marker3 = createMarker( 773.59997558594, 1884.5999755859, 3.7000000476837, "Cylinder", 2, 143, 7, 49, 255) local marker4 = createMarker( -1314, 2704.3999023438, 48.900001525879, "Cylinder", 2, 143, 7, 49, 255) local marker5 = createMarker( -1487.9000244141, 663.59997558594, 6.199999, "Cylinder", 2, 143, 7, 49, 255) local marker6 = createMarker( -2594.8000488281, 583.20001220703, 13.39999961853, "Cylinder", 2, 143, 7, 49, 255) local marker7 = createMarker( -2677.3999023438, 400.29998779297, 3.4000000953674, "Cylinder", 2, 143, 7, 49, 255) GUIEditor = { label = {}, staticimage = {} } PANEL = guiCreateWindow(119, 69, 571, 476, "", false) guiWindowSetSizable(PANEL, false) guiSetAlpha(PANEL, 0.87) IMAGEN = guiCreateStaticImage(9, 10, 553, 455, "imagen.png", false, PANEL) PLAZITA = guiCreateButton(40, 92, 136, 82, "San Fierro", false, IMAGEN) guiSetAlpha(PLAZITA, 0.30) guiSetFont(PLAZITA, "default-small") AMU2 = guiCreateButton(376, 90, 139, 84, "Ammu-Nation LV", false, IMAGEN) guiSetAlpha(AMU2, 0.30) guiSetFont(AMU2, "default-small") TERRORISTAS = guiCreateButton(205, 90, 140, 84, "Base Terroristas", false, IMAGEN) guiSetAlpha(TERRORISTAS, 0.30) guiSetFont(TERRORISTAS, "default-small") QUEBRADOS = guiCreateButton(39, 204, 137, 82, "The Quebrados", false, IMAGEN) guiSetAlpha(QUEBRADOS, 0.30) guiSetFont(QUEBRADOS, "default-small") AMU1 = guiCreateButton(204, 203, 141, 83, "Ammu-Nation LS", false, IMAGEN) guiSetAlpha(AMU1, 0.30) guiSetFont(AMU1, "default-small") POLICE = guiCreateButton(376, 204, 139, 82, "Comandancia SF", false, IMAGEN) guiSetAlpha(POLICE, 0.30) guiSetFont(POLICE, "default-small") SANTOS = guiCreateButton(38, 316, 138, 89, "Los Santos", false, IMAGEN) guiSetAlpha(SANTOS, 0.30) guiSetFont(SANTOS, "default-small") HOSPITAL = guiCreateButton(206, 319, 139, 81, "Hospital SF", false, IMAGEN) guiSetAlpha(HOSPITAL, 0.30) guiSetFont(HOSPITAL, "default-small") CANCELAR = guiCreateButton(366, 304, 172, 131, "", false, IMAGEN) guiSetAlpha(CANCELAR, 0.00) function teleport(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(PANEL) then guiSetVisible(PANEL, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, teleport) addEventHandler("onClientMarkerHit", marker1, teleport) addEventHandler("onClientMarkerHit", marker2, teleport) addEventHandler("onClientMarkerHit", marker3, teleport) addEventHandler("onClientMarkerHit", marker4, teleport) addEventHandler("onClientMarkerHit", marker5, teleport) addEventHandler("onClientMarkerHit", marker6, teleport) addEventHandler("onClientMarkerHit", marker7, teleport) function PLAZITAA () triggerServerEvent ( "onGreeting", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", PLAZITA , PLAZITAA, false) function AMU22 () triggerServerEvent ( "onGreeting1", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", AMU2 , AMU22, false) function HOSPITALL () triggerServerEvent ( "onGreeting2", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", HOSPITAL , HOSPITALL, false) function AMU11 () triggerServerEvent ( "onGreeting3", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", AMU1 , AMU11, false) function TERRORISTASS () triggerServerEvent ( "onGreeting4", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", TERRORISTAS , TERRORISTASS, false) function QUEBRADOSS () triggerServerEvent ( "onGreeting5", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", QUEBRADOS , QUEBRADOSS, false) function POLICEE () triggerServerEvent ( "onGreeting6", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", POLICE , POLICEE, false) function SANTOSS () triggerServerEvent ( "onGreeting7", getLocalPlayer() ) guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", SANTOS , SANTOSS, false) function CANCELARR () guiSetVisible(PANEL, false) showCursor(false) end addEventHandler("onClientGUIClick", CANCELAR , CANCELARR, false)
-
oh yeah finally i done thank you
-
I am trying add a command to restartscores which are in the account but that seems not to work local function resetScores (element) setAccountData(element, "kills", 0) setAccountData(element, "deaths", 0) setAccountData(element, "self", 0) setAccountData(element, "ratio", "-") local status = "" if isPedDead(element) then status = "Dead" end setAccountData(element, "status", status) end addCommandHandler("restartscore", resetScores) addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer then local account = getPlayerAccount ( killer ) if killer ~= source then setAccountData( account,"totalkillsdeaths.Kills",tonumber">tonumber">tonumber">tonumber">tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) +1 ) setElementData( killer, "kills", tonumber">tonumber">tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) ) ) setElementData( killer, "ratio", tonumber">tonumber">tonumber(getElementData( killer, "kills" )/getElementData( source, "deaths") ) ) end else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"totalkillsdeaths.Deaths",tonumber">tonumber( getAccountData(accountSource,"totalkillsdeaths.Deaths") or 0 ) +1 ) setElementData( source, "deaths", tonumber">tonumber">tonumber">tonumber">tonumber( getAccountData( accountSource,"totalkillsdeaths.Deaths" ) ) ) setElementData( source, "ratio", getElementData( killer, "kills" )/getElementData( source, "deaths") ) end end ) addEventHandler( "onPlayerLogin",root, function( thePreviousAccount, theCurrentAccount, autoLogin ) local account = getPlayerAccount ( source ) if not getAccountData( account,"totalkillsdeaths.Kills" ) and not getAccountData( account,"totalkillsdeaths.Deaths" ) then setAccountData( account,"totalkillsdeaths.Kills",0 ) setAccountData( account,"totalkillsdeaths.Deaths",0 ) end setElementData( source,"deaths",tonumber">tonumber">tonumber( getAccountData( account,"totalkillsdeaths.Deaths" ) or 0 ) ) setElementData( source,"kills",tonumber">tonumber">tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) ) setElementData( source, "ratio", getElementData( source, "kills" )/getElementData( source, "deaths") ) end ) addEventHandler( "onResourceStart",resourceRoot, function( ) outputDebugString( "add Total Kills to scoreboard Return: "..tostring">tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "kills",root,2, 0.100 ) ) ) outputDebugString( "add K/D R to scoreboard Return: "..tostring">tostring">tostring">tostring">tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "ratio",root,4, 0.100 ) ) ) outputDebugString( "add Total Deaths to scoreboard Return: "..tostring">tostring">tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "deaths",root,3, 0.100 ) ) ) end )
-
oh i understand, i now understand that it's impossible for me Thank you men.
-
Well, as everyone has ever wondered .. ¿How to restrict spawn teams? i mean spawn by50p but i have not found an answer about this.. I heard it's possible modifying s-main.lua but i don't know how to do.. anyone can tell me functions? or can modify for my? g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs">ipairs">ipairs">ipairs">ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then class.team = nil; end end end end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs">ipairs">ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs">ipairs">ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end print">print( "number of players in team: " .. tostring">tostring">tostring">tostring">tostring( countPlayersInTeam( getPlayerTeam( player ) ) ) ); end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end )
-
i want to do it too someone can to help me? i'll pay for this $