Juan_Camilo
-
Posts
25 -
Joined
-
Last visited
Everything posted by Juan_Camilo
-
Hello, could you help me? I am creating a punishment panel, but I am missing a set timer to kill punished players and return to normal. Could you help me?
-
client
function castig() local screenW, screenH = guiGetScreenSize() jail = guiCreateWindow((screenW - 419) / 2, (screenH - 462) / 2, 419, 462, "CASTIGO", false) guiWindowSetSizable(jail, false) guiSetProperty(jail, "CaptionColour", "FF00EBF9") juga = guiCreateGridList(22, 50, 176, 384, false, jail) guiGridListAddColumn(juga, "Jugadores", 0.9) for _, player in ipairs(getElementsByType("player")) do guiGridListAddRow(juga, getPlayerName(player)) end castiga = guiCreateButton(259, 90, 107, 33, "Castigar", false, jail) guiSetProperty(castiga, "NormalTextColour", "FF2300FC") barb = guiCreateButton(259, 214, 107, 33, "Barbie", false, jail) guiSetProperty(barb, "NormalTextColour", "FFFA00EC") clove = guiCreateButton(259, 352, 107, 33, "Cerrar", false, jail) guiSetProperty(clove, "NormalTextColour", "FFFE0000") showCursor (true) end addEvent( "onCasti", true ) addEventHandler( "onCasti", localPlayer, castig ) addEventHandler('onClientGUIClick',root, function() if source == clove then guiSetVisible(jail,false) showCursor(false) end end) addEventHandler('onClientGUIClick',root, function() if source == castiga then local row = guiGridListGetSelectedItem(juga) local text = guiGridListGetItemText(juga,row,1) if ( row > -1 ) then triggerServerEvent('setCastigo',getPlayerFromName(text)) guiSetVisible(jail,false) showCursor(false) end end end) addEventHandler('onClientGUIClick',root, function() if source == barb then local row = guiGridListGetSelectedItem(juga) local text = guiGridListGetItemText(juga,row,1) if ( row > -1 ) then triggerServerEvent('setCastigoNo',getPlayerFromName(text)) guiSetVisible(jail,false) showCursor(false) end end end)
server
addCommandHandler ("castigo", function ( playerSource ) local cuenta = getAccountName(getPlayerAccount(playerSource)) if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIP")) then triggerClientEvent ( playerSource, "onCasti", playerSource) end end ) addEvent("setCastigo", true) addEventHandler("setCastigo", root, function() setElementPosition ( source , 345.5478515625, 302.33984375, 999.93817138672 ) setElementDimension ( source, 1 ) setElementInterior ( source, 6 ) end) addEvent("setCastigoNo", true) addEventHandler("setCastigoNo", root, function() setElementPosition ( source , 1485.6689453125, -1757.4423828125, 17.53125 ) setElementDimension ( source, 0 ) setElementInterior ( source, 0 ) end)
-
Hello, could you help me? I am creating a punishment panel, but I am missing a set timer to kill punished players and return to normal. Could you help me?
-
tengo una duda he creado este panel para cambiar de team es decir que yo le cambie el team a un jugador pero cuando le doy "CONTRATAR" me cambia el team a mi que hago?
client
function empre() local screenW, screenH = guiGetScreenSize() contrataciones = guiCreateWindow((screenW - 628) / 2, (screenH - 430) / 2, 628, 430, "NOMBRE DE LA EMPRESA", false) guiSetProperty(contrataciones, "CaptionColour", "FF0036FE") jugador = guiCreateGridList(44, 43, 233, 338, false, contrataciones) guiGridListAddColumn(jugador, "Jugadores", 0.9) for _, player in ipairs(getElementsByType("player")) do guiGridListAddRow(jugador, getPlayerName(player)) end contrar = guiCreateButton(368, 107, 176, 43, "CONTRATAR", false, contrataciones) guiSetProperty(contrar, "NormalTextColour", "FF2FFD00") x = guiCreateButton(574, 33, 44, 42, "X", false, contrataciones) guiSetProperty(x, "NormalTextColour", "FFFC0000") despe = guiCreateButton(368, 251, 176, 43, "DESPEDIR", false, contrataciones) guiSetProperty(despe, "NormalTextColour", "FFFC0000") showCursor (true) end addEvent( "onEmpresa", true ) addEventHandler( "onEmpresa", localPlayer, empre ) addEventHandler('onClientGUIClick',root, function() if source == contrar then triggerServerEvent('setEmpresa',localPlayer) guiSetVisible(contrataciones,false) showCursor(false) end end) addEventHandler('onClientGUIClick',root, function() if source == despe then triggerServerEvent('setEmpresaNo',localPlayer) guiSetVisible(contrataciones,false) showCursor(false) end end) addEventHandler('onClientGUIClick',root, function() if source == x then guiSetVisible(contrataciones,false) showCursor(false) end end)
server
empresa = createTeam("TEAM", 0, 255, 0) --team addEvent('setEmpresa',true) --contratar, addEventHandler('setEmpresa',root, function() local teamPlayer = getPlayerTeam ( source ) if teamPlayer then setPlayerTeam ( source, nil ) setPlayerTeam ( source, empresa ) else setPlayerTeam ( source, empresa ) end end) addEvent('setEmpresaNo',true) --despedir addEventHandler('setEmpresaNo',root, function() local playerTeam = getPlayerTeam( source ) if ( getTeamName( playerTeam ) == "TEAM" ) then --team setPlayerTeam ( source, nil ) end end) addCommandHandler ("empresa", --Comando, no confundir con teleport function ( playerSource ) account = getPlayerAccount(playerSource) accname = getAccountName(account) if( accname == "Juan_Camilo" ) then -- lo que esta dentro de las comillas es el nombre de la cuenta que tiene permitido usar el comando. triggerClientEvent ( playerSource, "onEmpresa", playerSource) end end )
-
-- client addEventHandler('onClientGUIClick',root, function() if source == contrar then local sel = guiGridListGetSelectedItem(jugador) if sel==-1 then outputChatBox( 'por favor seleccione jugador',255,0,0 ) return end local plrname = guiGridListGetItemText(jugador , sel , 1) if not getPlayerFromName(plrname) then outputChatBox( 'no puedo encontrar jugador',255,0,0 ) return end triggerServerEvent('setEmpresa',localPlayer , getPlayerFromName(plrname)) guiSetVisible(contrataciones,false) showCursor(false) end end) --server addEvent('setEmpresa',true) --contratar, addEventHandler('setEmpresa',root, function(plr) setPlayerTeam ( plr, empresa ) end)
No puedo hablar español pero prefiero
-
-
Hello, could you help me with a problem that I have, I have been making a marker with a panel to spawn cars but I have not managed to spaw one at a time, what do I do in that case?
-
hola de nuevo, ahora tengo otro problema hice un marker con un panel que spawnea vehículos pero necesito que solo me spawne un vehículo a la vez que hago en ese caso
-
hola de nuevo, ahora tengo otro problema hice un marker con un panel que spawnea vehículos pero necesito que solo me spawne un vehículo a la vez que hago en ese caso
-
hola me podria ayudar con otra cosa lo que quiero es que al entrar a un marcador y se seleccione un boton se cambie de team si me podria ayudar se lo agradeceria muchisimo
-
Hola. Me podria ayudar a darle la funcion a un boton de un panel de concesionario para traer el auto por favor
gracias
-
Hello, i'm sorry but i'm not a programmer.
Can you please try asking your question in the Spanish language section at https://forum.mtasa.com/forum/166-spanish-español/