Jump to content

Monsthers

Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by Monsthers

  1. So? I'm Learning scripting --***********************************-- --***********************************-- -- Jail System -- -- By ZerO^^ -- -- Server Side -- --***********************************-- --***********************************-- Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler ---So?? local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Fundador" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Staff" ) ) then end end ) function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("*#FF0000"..getPlayerName(thePlayer).." Ha sido encarcelado por #00FF00[ "..getPlayerName(source).." #FF0000] y enviado a "..theJail[1].." por "..time,thePlayer,255,0,0,true) end outputChatBox("*#FF0000Fue encarcelado por insultar,molestar o romper reglas del servidor.",root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Por favor seleccione un tiempo !",source,255,0,0,true) end else outputChatBox("** #FFFF00Por favor seleccione una prision !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Por favor seleccione un jugador !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).."] Ha sido liberado por el admin corrupto #FF0000[ "..getPlayerName(source).."] Por favor reportar y seras recompenzado.",source,255,0,0,true) end setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Tiempo restante : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimerShit(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimerShit(plr,timer,time) -- to sort timer's shit .. if timer and time then if isTimer(timerShitTimer) then killTimer(timerShitTimer) end timerShitTimer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timerShitTimer) then killTimer(timerShitTimer) end end function onTimerFinish(Player) -- on timer end stopJailTimer(Player) triggerEvent("onJailEnd",Player,Player) end Line 51-55
  2. Hello everyone! I have a adminjail of mta community, But I have a problem, this script is only for group in acl "Admin" and I want what be for Group (Fundador,Admin,Staff) and too I don't See the line with the function local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) Client --***********************************-- --***********************************-- -- Jail System -- -- By ZerO^^ -- -- Client Side -- --***********************************-- --***********************************-- -- 1.0 Made At 3/9/2011 | 12:15 PM -- -- 2.0 Made At 3/2/2012 | 06:15 PM -- -- 2.1 Made At 22/5/2012 | 4:00 PM -- lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) setElementData(lp,"jailed",false) ------ addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getDataz",lp,lp) outputDebugString("Sistema de PrisionAdmin") end ) desz = {} addEvent("sendDataz",true) addEventHandler("sendDataz",root,function(jTable,tTable) ------ jWin = guiCreateWindow(460,172,445,416,"Sistema de PrisionAdmin",false) --- Center Window --- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(jWin,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(jWin,x,y,false) ----- Center Window ----- guiSetVisible(jWin,false) guiWindowSetSizable(jWin,false) ------------------------- jBut = guiCreateButton(247,338,167,31,"Encarcelar",false,jWin) tGrid = guiCreateGridList(240,184,190,144,false,jWin) guiGridListSetSelectionMode(tGrid,0) ------- -- sEdit = guiCreateEdit(14,380,217,23,"Buscar ..",false,jWin) -- -------- local timeC = guiGridListAddColumn( tGrid, "Tiempo", 0.85 ) if timeC then for k,v in ipairs ( tTable ) do local time = v[1] local des = v[2] local row = guiGridListAddRow ( tGrid ) desz[row] = des guiGridListSetItemText ( tGrid, row, timeC, time.." "..des, false, true ) end local row = guiGridListAddRow ( tGrid ) guiGridListSetItemText ( tGrid, row, timeC,"Otros ..", false, true ) end -------- jGrid = guiCreateGridList(240,31,190,144,false,jWin) guiGridListSetSelectionMode(jGrid,0) -------- local jailC = guiGridListAddColumn( jGrid, "Prision", 0.85 ) for k,v in ipairs ( jTable ) do local name = v[1] local row = guiGridListAddRow ( jGrid ) guiGridListSetItemText ( jGrid, row, jailC, name, false, false ) end jcBut = guiCreateButton(246,378,172,24,"Cerrar",false,jWin) function jailShow () guiSetVisible(jWin,not guiGetVisible ( jWin ) ) showCursor(guiGetVisible ( jWin ) ) guiSetInputEnabled(guiGetVisible ( jWin ) ) destroyElement(pList) -- Players List pList = guiCreateGridList(14,31,218,338,false,jWin) column = guiGridListAddColumn( pList, "Jugador", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end -- Players List end addEvent("jailShow",true) addEventHandler("jailShow",root,jailShow) function changeText(button,state,x,y) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) local thePlr = getPlayerFromName(sPlayer) if thePlr then local isJailed = getElementData(thePlr,"jailed") if isJailed == false then guiSetText(jBut,"Encarcelar") elseif isJailed == true then guiSetText(jBut,"Soltarlo") end end end addEventHandler("onClientGUIClick",root,changeText) function onClick (button, state, absoluteX, absoluteY) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) jail = guiGridListGetItemText ( jGrid, guiGridListGetSelectedItem ( jGrid ), 1 ) time = guiGridListGetItemText ( tGrid, guiGridListGetSelectedItem ( tGrid ), 1 ) timeDes = tostring(desz[guiGridListGetSelectedItem ( tGrid )]) if ( source == jBut ) then if guiGetText(jBut) == "Encarcelar" then if time ~= "Other .." then triggerServerEvent("JailHimx",lp,sPlayer,jail,time,timeDes) else createTimeSelect(sPlayer,jail) end elseif guiGetText(jBut) == "Soltarlo" then triggerServerEvent("unJailHim",lp,sPlayer) end ---------- elseif ( source == jcBut ) then guiSetVisible (jWin, false) showCursor (false) guiSetInputEnabled(false) end end addEventHandler( "onClientGUIClick", root, onClick ) ------------ end ) addEventHandler("onClientPlayerDamage",root,function(at) if getElementData(source,"jailed") == true then if at then cancelEvent() end end end ) ------- addEventHandler("onClientGUIClick",root,function() if source == sEdit then guiSetText(sEdit,"") --[[ else guiSetText(sEdit,"Search ..") --]] end end ) addEventHandler("onClientGUIChanged",root,function() if source == sEdit then ------ guiGridListClear(pList) for k,v in ipairs ( getElementsByType("player") ) do local name = string.lower(getPlayerName(v)) if name then if string.find (name,string.lower(guiGetText(sEdit)) ) then row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( v ), false, false ) end end end end ------ end ) ------ function createTimeSelect(theJailed,theJail) if not tostring(theJailed) then outputChatBox("** #FFFF00Por favor seleccione un jugador!",255,0,0,true) return end if not tostring(theJail) then outputChatBox("** #FFFF00Por favor seleccione una prision !",255,0,0,true) return end if isElement(TimeSelect_Window) then return end TimeSelect_Window = guiCreateWindow(550,397,270,125,"Introduzca un tiempo",false) -- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(TimeSelect_Window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(TimeSelect_Window,x,y,false) -- -- guiSetVisible(jWin,false) -- TimeSelect_Edit = guiCreateEdit(15,37,89,26,"",false,TimeSelect_Window) TimeSelect_Label = guiCreateLabel(110,41,10,15,"in",false,TimeSelect_Window) TimeSelect_Grid = guiCreateGridList(126,31,130,95,false,TimeSelect_Window) guiGridListSetSelectionMode(TimeSelect_Grid,2) --- column = guiGridListAddColumn( TimeSelect_Grid, "", 0.80 ) r1 = guiGridListAddRow(TimeSelect_Grid) r2 = guiGridListAddRow(TimeSelect_Grid) r3 = guiGridListAddRow(TimeSelect_Grid) guiGridListSetItemText ( TimeSelect_Grid , r1, column, "Horas", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r2, column,"Minutos", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r3, column, "Segundos", false, false ) TimeSelect_Button = guiCreateButton(14,72,91,40,"OK",false,TimeSelect_Window) -- function onOk() if source == TimeSelect_Button then -- removeEventHandler("onClientGUIClick",root,onOk) -- ---------------- theTime = guiGetText(TimeSelect_Edit) timeType = guiGridListGetItemText ( TimeSelect_Grid, guiGridListGetSelectedItem ( TimeSelect_Grid ) ) -- destroyElement(TimeSelect_Window) jailShow () -- if tonumber(theTime) then if tostring(timeType) then triggerServerEvent("JailHimx",lp,theJailed,theJail,theTime.." "..timeType,timeType,true) else outputChatBox("** #FFFF00Por favor seleccione hora,minuto o segundos!",255,0,0,true) end else outputChatBox("** #FFFF00Por favor introduzca un tiempo!",255,0,0,true) end ---------------- end end addEventHandler("onClientGUIClick",root,onOk) end Server-- --***********************************-- --***********************************-- -- Jail System -- -- By ZerO^^ -- -- Server Side -- --***********************************-- --***********************************-- Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("*#FF0000"..getPlayerName(thePlayer).." Ha sido encarcelado por #00FF00[ "..getPlayerName(source).." #FF0000] y enviado a "..theJail[1].." por "..time,thePlayer,255,0,0,true) end outputChatBox("*#FF0000Fue encarcelado por insultar,molestar o romper reglas del servidor.",root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Por favor seleccione un tiempo !",source,255,0,0,true) end else outputChatBox("** #FFFF00Por favor seleccione una prision !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Por favor seleccione un jugador !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).."] Ha sido liberado por el admin corrupto #FF0000[ "..getPlayerName(source).."] Por favor reportar y seras recompenzado.",source,255,0,0,true) end setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Tiempo restante : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimerShit(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimerShit(plr,timer,time) -- to sort timer's shit .. if timer and time then if isTimer(timerShitTimer) then killTimer(timerShitTimer) end timerShitTimer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timerShitTimer) then killTimer(timerShitTimer) end end function onTimerFinish(Player) -- on timer end stopJailTimer(Player) triggerEvent("onJailEnd",Player,Player) end And too change command for /adminjail Please Help Me! what be for group in acl (Fundador,Admin,Staff) Thanks everyone!
  3. Alguna guia de como iria la estructura de este script?
  4. Hola comunidad de mta! pues ya e solucionado mi caso en el post anterior! si te interesa puedes pasarte te puede servir de mucho Pues necesito algo de ayuda! e entrado a server donde hay 300 jugadores online y en el mapa no sale ningun blip de jugador! [Estan invisibles] Pero si me acerco a otro jugador en el mapa efectivamente sale su blip asta que el se aleje y yo no lo vea.. Ejemplo = Estoy yo en los santos solo (No sale ningun blip en el mapa) se me acerca un jugador (sale el blip del jugador que se me acerco en el radar y f11) una vez que el jugador se aleje 100 metros el blip va desapareciendo mientras mas distacia en se aleje! asta que desaparece y vuelve a estar el mapa sin ningun blip! Pues me e puesto a leer la wiki buscando funciones de blip y eso y no encuentro una que me sirva para eso! Porfa alguna ayuda? algun codigo? algunas sugerencia? funciones? Gracias ante mano
  5. Gracias a los que me ayudaron! pues fue muy util su ayuda me sirvio! pero encontre un script en la comunidad llamado vehiclesql que me crea carros en el juego para team,clase y para cuenta! aun asi gracias
  6. Entonces no creo que puedas pagar a través de Paygol si el mismo servicio inhabilita tu país No es que paygol bloquee a venezuela, si no que la empresa de hosting al poner el ticket bloquea venezuela y otros paises pero en mi caso venezuela Que opinas de delux-host? confiable? no lag? roba script?
  7. ¿Qué ocurre con eso? Ahí dice que no borren los créditos (cosa que no hizo) y que se sientan libres de editarlo. Sobre el tema principal, me parece que sería útil que nos muestres como funcionan esas "classes", ya que la solución se enraíza en eso. El dice que en un grupoo criminales existen digamos como clasificaciones que son Ladrones y Hooker, creo. Exacto! el server funciona por medio de un panel de spawn o desove! el cual al spawnearse como criminal queda asi en el scoredboard! team = Criminal | Class = Ladron O team = Criminal | Class = Prostituta Asi!
  8. Hola tengo un script de bloque de autos por team! es decir los coches que yo mismos spawnee en el script son bloqueados para dicho team ejemplo los carros de policias solo para el team de policia, Pues bueno creo que ya entendieron xdd Pues mi pregunta es mi servidor se basa en team y clases ejemplo en el team criminal por ahora tengo 2 clases = Ladron y prostituta pues tengo autos para prostituta y autos para ladron, como ago que dichos autos solo sean para la clase ladron? y no para el team de criminal completo? asi mismo como ago que los autos solo sean para la clase Prostituta y no para el team criminal completo? Gracias antemano local vehicle1 = { {542, 196.8, -1434.9, 13, 0, 0, 136}, --Ladron {542, 198.7, -1437.3, 13, 0, 0, 136}, {482, 205.10001, -1442.1, 13.4, 0, 0, 139.999}, {482, 216.39999, -1429.4, 13.4, 0, 2, 139.999}, {482, 213.8, -1426.7, 13.4, 0, 0, 139.999}, {482, 201.8, -1439.7, 13.4, 0, 0, 139.999}, {542,211, -1423.5, 13, 0, 0, 136}, {542, 208.3, -1421.3, 13, 0, 0, 136}, {482, -2213, 637.59998, 49.7, 0, 0, 272}, {482, -2213.3, 643.59998, 49.7, 0, 0, 272}, {482, 1677.6, 988.40002, 11.1, 0, 0, 0}, {482, 1667.9, 988.5, 11.1, 0, 0, 0}, {482, 1672.6, 988.40002, 11.1, 0, 0, 358}, {462, 1340.5, -1826, 13.2, 0, 0, 0}, --Puta {462, 1337.5, -1826, 13.2, 0, 0, 0}, {462, 1337.5, -1829.7, 13.2, 0, 0, 0}, {462, 1340.5, -1829.7, 13.2, 0, 0, 0}, {462, 1337.5, -1833.7, 13.2, 0, 0, 0}, {462, -2687.1001, 1415.2, 6.8, 0, 0, 78}, {462, -2687.5, 1413.2, 6.8, 0, 0, 77.997}, {462, -2688, 1411, 6.8, 0, 0, 77.997}, {462, -2688.3999, 409.3, 6.8, 0, 0, 77.997}, {462, -2688.8999, 1407.1, 6.8, 0, 0, 77.997}, {462, 2511.1001, 1671.5, 10.5, 0, 0, 272}, {462, 2511, 1668, 10.5, 0, 0, 272}, {462, 2511, 1664.8, 10.5, 0, 0, 276}, {462, 2511, 1662.1, 10.5, 0, 0, 275.999}, {462, 2511, 1659.1, 10.5, 0, 0, 279.999}, } function CreateVehiclesBegin(name) if getThisResource() == name then for i,v in ipairs(vehicle1) do local vehicle = createVehicle( v[1], v[2], v[3], v[4], v[5], v[6], v[7] ) setElementData (vehicle, "VehicleToCriminales", "ToTeamCriminales") setVehicleDamageProof(vehicle, true) local state = setVehicleDoorState ( vehicle, 1, 1 ) end end end addEventHandler("onResourceStart", root, CreateVehiclesBegin) function lockPrivate( player, seat, jacked ) if ((source) and (getElementData (source, "VehicleToCriminales") == "ToTeamCriminales")) then local playerTeam = getPlayerTeam ( player ) local oldTeamName = getTeamName ( playerTeam ) if ( oldTeamName ~= "Criminales" ) then cancelEvent() exports.SAcommands:sendMessage("*INFO* Para utilizar este vehiculo tienes que ser del Team: Criminales", 240,240,240) else exports.SAcommands:sendMessage("*INFO* Bievenido a su vehiculo, Señor!", 240,240,240) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) -----Made by Alen141(ingame name:Jimboy)------ -----Special thanks to : Solidsnake14(ingame name:Castillo)----- -----Visit SAUR Utopia RPG, IP: 128.204.203.103:22003----- -----Feel free to edit script on your own----- -----Don't remove credits-----
  9. Porque hay hosting que ofrecen paygol pero tiene el paygol configurado que no sea compatible con venezuela osea el paygol sirve para todo el mundos menos venezuela
  10. Hello , because as you can see in the title I need scripters because I have an RPG server and e kept alone, but only I can not do everything , it has some bugs do not e able to repair and even lacks but I'm studying and I was not given no time to continue learning scriptear ! then, I would form a small and humble community server for those who want to help out the server up front . using this server will be one of the largest in MTA for now I have only the RPG community but if we are able to bring new servers horn [ I have no money to pay for a scripter ]
  11. Nadien sabe sobre un hosting que ofresca como metodo de pago paygol? y que sea compatible con venezuela?
  12. Hola, pues como puedes ver en el titulo necesito scripters pues tengo un servidor RPG y lo e mantenido yo solo, pero solo no puedo hacer todo, tiene algunos bugs que no e podido reparar y aun le falta pero ando estudiando y no me a dado ni tiempo para seguir aprendiendo a scriptear! entonces, quisiera formar una pequeña y humilde comunidad del server pues los que quiera ayudar a salir alante al servidor. con ayuda este servidor sera uno de los grandes en MTA por ahora solo tengo el RPG pero si formamos la comunidad podremos asta sacar nuevos servers [No tengo dinero para pagar un scripter]
  13. Te recomiendo http://www.cydrio.com/ el plan mas caro de cydrio es de 1,90USD al mes, muy economico, Aparte estoy usando cydrio y me va perfecto, no lag y lo mejor es que el soporte es en español y rapido
  14. Descripción SAMS:RPG Es un servidor donde tratamos de dar la mayor experiencia en juego nunca antes vista! cada jugador puede ejecutar el trabajo que mas le guste, ya sea criminal o policia o hasta boxeador o taxista, no solo nos centramos en el los trabajos sino que tambien colocamos cosas en todo el mapa de san andreas para hacer un juego mas realista! Eso no es todo, Apenas SAMS comienza! Historia Un grupo de amigos y yo, estábamos pensando en abrir un servidor para MTA aun no teníamos la idea clara de que hacer! pensábamos hacer un servidor de Resident evil o un servidor de Race estilo Need For Speed! pero luego de pensarlo bien decidimos hacer un RPG, el proyecto empezó marcha el 23 de julio del 2015! luego de llevar un 35% del servidor, el grupo de amigos decidieron dejar el proyecto por no tener tiempo ni para seguirlo ni para administrarlo! Después de eso el proyecto estuvo inactivo por un tiempo y decidí retomarlo yo solo el 10 de septiembre del 2015, pensaba que el servidor lo terminaría para octubre ya asta había puesto publicaciones de que lo abriría en octubre, pero no fue haci hacer un RPG no están fácil y llevo mas tiempo, Gracias ala todas las personas del foro este proyecto asta ahora esta ONLINE! Scripts En esta parte aclarare algo muy importante que ya muchos saben y otros no! ¿De donde sacaste los script? como dije un poco mas arriba SAMS estaba terminado un 35% osea que ya tenia algunos scripts, Pero como todos saben tengo 3 Script SAES! Muchos me reclamaban diciendo que eran script de SAUR o de SX pero en ese entonce utilizaba era el GM Nerd Gaming! ¿De donde sacate los script saes? Un video en youtube donde publico un enlance a mediafire de donde saque los 3 script SAES! ¿Todo tu servidor es de script SAES? No como dije arriba ya teniamos SAMS un 35% listo osea que no tengo nada de SAES solo esos 3 script y ya! y creo que muchos saben cuales son ya que me an bloqueado esos post! Espero que luego de aclarar esto en el mismo post donde publico mi servidor dejen las criticas y las punticas diciendo que son robados o que todo mi server es de script SAES! Sistemas *Sistema de arresto y prision *Sistema de restaurantes *Sistema de compra de auto *Sistema de robos de casa *Sistema de publicidad (Por fotos)Y por (Texto) *Sistema de spawn *Sistema de prision para admin (Si rompes reglas iras hay) *Sistema de login *Sistema de banco *Sistema de restrinccion para gang,team, o admin *Sistema de eventos *Sistema de ammunations Y muchos mas, Puedes ir descubriendolos por tu cuenta entrando en SAMS:RPG Fotos Del Servidor Esperamos Verte En SAMS:RPG Soy nuevo con esto de las fotos en el foro
  15. Y Gracias AFK ya tengo una idea mas clara de que hacer!
  16. Hey starksZ sinceramente no se que te pasa. acepto los reclamos de AFK porque en verdad e echo varios post y ni para poner "Solucionado" y ni las gracias doy! hay acepto mi culpa y no volvera a pasar! Pero el que llego al post incitando pelea as sido tu, AFK me estaba ayudando normalmente y tu vienes desviando la parte, si bloquean el post es por culpa tuya! dises que el foro se va ala mierda en tu spoiler y se va ala mierda con personas como tu " O mas simple si no nos cae bien no le ayudemos " Y se que me ayudabas al principio pero ahora no se que te pasa!
  17. Por esa parte si lo siento, que no agradesco los post que me ayudan! es que aveces ando apurado y coloco el script como ustedes me ayudan y asta se me volvida volver al foro! Ahora sobre el problema, No tengo ni idea de como usaria esa funcio? ok coloco las cordenadas de donde quiero que este la camara! pero es bloqueara asta que se cargen todos los script?
  18. Hola quisiera saber como ago que para cuando los jugadores entren a mi server! no pueda interactuar en el asta que finalize la descarga? osea ahorita mismo un jugador entra al server y mientra espera la descarga el puede jugar y asi no conviene! lo ideal fuera que mientras se descargue se quede una camara mirando fijamente a una parte de todo san andreas asta que finalize su descarga y le salga directamente el login y despues del login pueda interactuar! Como aria para poner una pantalla de carga? Algun Guion que me puedan pasar? no tengo ni la minima idea de como lo aria?
  19. Hola tengo un servidor de mta y pues tiene un problema, La descarga de mapas va muy pero muy lenta diria yo que dura mas de 5 minutos y no es el peso del server porque pesa 2MB, ni tampoco es mi internet porque entro a otros server y la descarga de mapas no dura ni 30 segundos! Entro a mi server la descarga de mapas dura mas de 5 minutos pero la descarga de resourcer me dura segundos ya que pesa 2MB Que tengo que ponerle para solucionarlo?
  20. Hola a todos los miembros del foro, antes que anda si vienes a echar mierda puedes irte, por favor no jodas el post! Pues bueno desde el 15 de diciembre abri un servidor RPG bastante basico pero un poco mejor a muchos RPG que e visto por hay (Para no decir nombres) Pero como siempre todo no anda bien! tengo algunos errores que con mi bajo pero bajo conocimiento de scripting no se reparar ¿Como hiciste un rpg sin saber scriptear? Pues me an ayudado muchos miembros de aqui del foro entre eso el retirado "El_Zorro" que fue de gran ayuda al server! entonces estoy buscando miembros scripting que se quieran unir a este proyecto, Yo me encargo de la parte del hosting, solo seria ayudarme en los script que tienen errores y si quiere puede aportar algo! luego cuando le saquemos provecho al server las ganancias seran divididas!
  21. Concuerdo contigo, aun con mi minimo conocimiento, SQL seria bien que lo usaras! pero como dise el zorro! sigue aprendiendo primero en lua antes de meterte con SQL
  22. Hello, i have this script and has one error, please help me Error [2015-12-08 17:56:21] ERROR: rpgLogin\sql.lua:24: Database query failed: no such column: loggedin [2015-12-08 17:56:21] ERROR: rpgLogin\sql.lua:26: attempt to index field '?' (a nil value) Script --[[ +---------------------------------------------------------------------------- | SAMS:RPG v1 | ======================================== | by SAMS Scripting Team | All rights reserved. | [url=http://www.sams.net]http://www.sams.net[/url] | ======================================== +----------------------------------------------------------------------------- | You are not allowed to adapt, copy, redistribute this script. | You are not allowed to use this script outside servers ran by [url=http://www.samsYUDA.net]www.samsYUDA.net[/url] +----------------------------------------------------------------------------- ]]-- local blockedUsernames = {["console"] = true,["admin"]= true,["moderator"]= true,["guest"]= true,["none"]= true,["saes"]= true,["[saes]"]= true,["sa housing agency"]= true,["sa_housing_agency"] = true} executeSQLQuery("CREATE TABLE IF NOT EXISTS user_data (id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT, pwsalted TEXT, groups TEXT, email TEXT, money INTEGER, wanted TINYINT, jailed BOOLEAN, lastnick TEXT, lastlogin TEXT)") function playerLogin(username,password,serial) if getElementData(source,"loggedIn") then return triggerClientEvent(source,"RPGlogin.errorBox",source,"You are already logged in.") end local ip = getPlayerIP(source) local playername = getPlayerName(source) local playerQuery = executeSQLQuery("SELECT id, loggedin FROM user_data WHERE username = ? AND pwsalted = ? LIMIT 1",username,password) if playerQuery and #playerQuery > 0 then if (playerQuery[1].loggedin == 1) then return triggerClientEvent(source,"RPGlogin.errorBox",source,"Your account is already in use.") end local account = setElementData(source,"username",username) local id = setElementData(source,"id",playerQuery[1].id) if account and id then local thetime = getRealTime() local MM = thetime.month+1 if MM < 10 then MM = "0"..MM end local DD = thetime.monthday if DD < 10 then DD = "0"..DD end local thedate = (thetime.year+1900).."-"..MM.."-"..DD local ip = getPlayerIP(source) local serial = getPlayerSerial(source) executeSQLQuery("UPDATE user_data SET lastlogin = '"..thedate.."', ip = '"..ip.."', serial = '"..serial.."', loggedin = 1 WHERE username = '"..username.."'") outputChatBox("You are now logged in as: "..username,source,0,255,255) setElementData(source,"loggedIn",true) triggerEvent("onPlayerLogIn",source,playerQuery[1].id,username) triggerClientEvent(source,"RPGlogin.clearLoginGUI",source) outputServerLog(("RPGlogin: %s has successfully logged in as %q. (IP: %s Serial: %s)"):format(playername,username,ip,serial)) triggerClientEvent(source,"RPGlogin.hideLogin",source,true) else triggerClientEvent(source,"RPGlogin.errorBox",source,"Login failed.") end elseif playerQuery then triggerClientEvent(source,"RPGlogin.errorBox",source,"Invalid password specified.") outputServerLog(("RPGlogin: %s failed to log in as %q. Wrong password. (IP: %s Serial: %s)"):format(playername,username,ip,serial)) else triggerClientEvent(source,"RPGlogin.errorBox",source,"An error occurred, please try again") end end addEvent("RPGlogin.playerLogin",true) addEventHandler("RPGlogin.playerLogin",root,playerLogin) function registerPlayer(username,password,email) if username and password and email then if not blockedUsernames[username] then if not username:match("[%s%p]") then local accountQuery = executeSQLQuery("SELECT id FROM user_data WHERE username=? LIMIT 1",username) if accountQuery and #accountQuery == 0 then if executeSQLInsert("user_data","'"..username.."','"..password.."','"..email.."',0,0,1000","'username','pwsalted','email','wanted','jailed','money'") then triggerClientEvent(source,"RPGlogin.showLogin",source) triggerClientEvent(source,"RPGlogin.errorBox",source,"Account registration completed. Your username is "..username..". Remember it.") else triggerClientEvent(source,"RPGlogin.errorBox",source,"Account registration failed") end elseif accountQuery and #accountQuery > 0 then triggerClientEvent(source,"RPGlogin.errorBox",source,"An account with this name has already been registered") else triggerClientEvent(source,"RPGlogin.errorBox",source,"Account registration failed") end else triggerClientEvent(source,"RPGlogin.errorBox",source,"The username you register must not contain any spacing or punctuation") end else triggerClientEvent(source,"RPGlogin.errorBox",source,"This username is blocked") end end end addEvent("RPGlogin.playerRegisterAccount",true) addEventHandler("RPGlogin.playerRegisterAccount",root,registerPlayer) function markAsLogOut() local id = getElementData(source,"id") if id then executeSQLUpdate("user_data","loggedin = 0","id = "..id) end end addEventHandler("onPlayerQuit", root,markAsLogOut) addEvent("onPlayerLogOut",true) addEventHandler("onPlayerLogOut",root,function() setElementData(source,"loggedIn",false) local username = getElementData(source,"username") local id = getElementData(source,"id") if id then executeSQLUpdate("user_data","loggedin = 0","id = "..id) end if not username then username = "N/A" end local ip = getPlayerIP(source) local serial = getPlayerSerial(source) if ip and serial then outputServerLog("RPGlogin: "..getPlayerName(source).." has logged out from '"..username.."' (IP: "..ip.." Serial: "..serial..")") end setElementData(source,"username",nil) setElementData(source,"id",nil) triggerClientEvent(source,"RPGlogin.showLogin",source) killPed(source) fadeCamera(source,false) setElementInterior(source,0) setElementDimension(source,0) end)
×
×
  • Create New...