Jump to content

HeXo

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by HeXo

  1. Ok. The last line IMAGE = guiCreateStaticImage(305,119,110,190,"images/0.png",false); function Countdown( seconds ) guiStaticImageLoadImage( IMAGE, "images/" .. tostring( seconds ) .. ".png" ); guiSetVisible( IMAGE, true ); if ( seconds > 0 ) then -- do we need to continue countdown? setTimer( Countdown, 1000, 1, seconds - 1 ); -- call this function again in 1sec. with decreased value of "seconds" else CountdownFinished( ) end end function CountdownFinished( ) guiStaticImageLoadImage(305,119,320,81,"images/go.png" ); setTimer( guiSetVisible, 2000, 1, IMAGE, false ); end addCommandHandler ( "countdown", Countdown ) doesn't count as a commandhandler?
  2. Sorry. So, now i'm stuck on this: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() IMAGE = guiCreateStaticImage(305,119,110,190,"images/0.png",false); function Countdown( seconds ) guiStaticImageLoadImage( IMAGE, "images/" .. tostring( seconds ) .. ".png" ); guiSetVisible( IMAGE, true ); if ( seconds > 0 ) then -- do we need to continue countdown? setTimer( Countdown, 1000, 1, seconds - 1 ); -- call this function again in 1sec. with decreased value of "seconds" else CountdownFinished( ) end end end); function CountdownFinished( ) guiStaticImageLoadImage(305,119,320,81,"images/go.png" ); setTimer( guiSetVisible, 2000, 1, IMAGE, false ); end addCommandHandler ( "countdown", Countdown ) I Have debugged it, but it don't show any error. Just don't work. Thanks
  3. I Wonder if that is right addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() IMAGE = guiCreateStaticImage(305,119,110,190,"images/0.png",false); -- put your own arguments here -- call this function to start countdown, eg. Countdown( 3 ); function Countdown( seconds ) guiStaticImageLoadImage( IMAGE, "images/" .. tostring( seconds ) .. ".png" ); guiSetVisible( IMAGE, true ); if ( seconds > 0 ) then -- do we need to continue countdown? setTimer( Countdown, 1000, 1, seconds - 1 ); -- call this function again in 1sec. with decreased value of "seconds" else CountdownFinished( ) end end function CountdownFinished( ) guiStaticImageLoadImage( IMAGE, "images/go.png" ); setTimer( guiSetVisible, 2000, 1, IMAGE, false ); end addCommandHandler ( "countdown", Countdown ) When i type "/countdown 3" nothing shows up. But if i change the guiCreateStaticImage(305,119,110,190,"images/0.png",false); to guiCreateStaticImage(305,119,110,190,"images/1.png",false); for example, the number 1 shows on the screen and stay there forever. Thanks for the help!
  4. I didn't get your point, it was already working the way it was. So, now i'm trying to create a new countdown script based on that one, but i dont know LUA very well. So, if you guys could help me, i would appreciate that. function countdownHandler() local px, py, pz = getElementPosition ( localPlayer ) local tx, ty, tz = getElementPosition( player ) local dist = getDistanceBetweenPoints3D ( px, py, pz, tx, ty, tz ) if dist < 1000 then --what goes here? end end addEvent( "onCountdown", true ) addEventHandler( "onCountdown", getRootElement(), countdownHandler ) Thanks.
  5. So... I've got this script (Credits to d0NuT)... function Countdown ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage(305,119,110,190,"images/3.png",false) setTimer ( Countdown2, 1000, 1 ) outputChatBox ( "countdown started", getRootElement(), 255, 255, 255, true ) end function Countdown2 ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage(305,119,110,190,"images/2.png",false) setTimer ( Countdown1, 1000, 1 ) end function Countdown1 ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage(305,119,110,190,"images/1.png",false) setTimer ( Countdown0, 1000, 1 ) end function Countdown0 ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage(305,119,320,81,"images/go.png",false) setTimer ( CountdownEnd, 3000, 1 ) end function CountdownEnd ( source ) guiSetVisible ( imagecount, false ) end addCommandHandler ( "countdown", Countdown ) How can i make to the guiCreateStaticImage appear not only to the local player, but to the others that are close? Thanks
  6. HeXo

    Spawning Issues!

    Well, i will follow 50p tip, my problem is solved now. Thanks subenji99, 50p and DarkDragon[GER] for the support
  7. HeXo

    Spawning Issues!

    Lol, thanks that solved the initial spawn. But now when i die nothing happens, the camera just keeps fading away and away. How can i make to the player re-spawn on the same place they died? Thanks alot!
  8. HeXo

    Spawning Issues!

    Sorry. Yes, i am running freeroam. And my server is the 1.0.2 version
  9. How can i make to players stop auto-spawning after joining the server, and only spawn when they select the place on the initial map?? Edit: Another thing. How can i make to players re-spawn on the place they died? Thanks for the help.
  10. HeXo

    ACL Question

    Hello everyone! Is there a way to make a resource only work for the admins on the ALC.xml file? How i can do this? When i try to do this with the webadmin i get this error: [18:36:56] WARNING: admin.lua: Access denied @ 'aclSetRight' - Line: 19 How can i fix that? Thanks! and sorry about my bad english.
  11. Hello everyone! Is there a way to make a resource only work for the admins on the ALC.xml file? How i can do this? When i try to do this with the webadmin i get this error: [18:36:56] WARNING: admin.lua: Access denied @ 'aclSetRight' - Line: 19 How can i fix that? Thanks! and sorry about my bad english.
  12. HeXo

    NameColor

    @dylan2en: Thank u, i have deleted the freeroam lines, now it works. @Gamesnert: If u can fix the security issues, the script will be perfect! Thanks for ur help.
  13. HeXo

    NameColor

    The Script grown alot But i'm still sending 2 messages, don't know why... i tryed to add the CancelEvent but it dont work either. If u can help me with this i'll be glad. Anyway Thanks for your help, u are helping me alot
  14. HeXo

    NameColor

    Yes, it's 1 with color and other without. i let my script this way: -- ************* IMPROVED RELEASE V1.0 *************** -- ************* MADE BY GAMESNERT *************** -- ************* SCRIPTNAME : *************** -- ************* NAMECOLOR (working version) *************** -- ************* A MUST HAVE FOR CLANS!! *************** -- ************* ORIGINAL BY: FATALITRY *************** accountdat={} function init() local xmlFile=xmlLoadFile("config.xml") if xmlFile then local configNode=true i=0 while configNode~=false do configNode=xmlFindSubNode(xmlFile,"user",i) if configNode then local xmlReadName=xmlNodeGetAttribute(configNode,"name") local xmlReadClass=xmlNodeGetAttribute(configNode,"class") accountdat[xmlReadName]={name=xmlReadName, class=xmlReadClass} accountdat[i+1]=accountdat[xmlReadName] else if i<1 then outputDebugString(getResourceName(getThisResource()) .. ": No users were found in the config file! The script won't have any effect!") end end i=i+1 end configNode=false configNode=xmlFindSubNode(xmlFile,"colors",0) if configNode then local readAdmin=xmlNodeGetAttribute(configNode,"admin") local readModerator=xmlNodeGetAttribute(configNode,"moderator") local readMember=xmlNodeGetAttribute(configNode,"member") accountdat["colors"]={["admin"]=readAdmin,["moderator"]=readModerator,["member"]=readMember} else outputDebugString(getResourceName(getThisResource()) .. ": No color setting could be found! The script won't have any effect!") end end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),init) function onPlayerTalk(msg,msgType) if msgType==0 then if accountdat[getClientName(source)] then class=accountdat[getClientName(source)].class else class="member" end local color=accountdat["colors"][tostring(class)] outputChatBox(color .. "[" .. class .. "] " .. getClientName(source) .. ": " .. "#FFFFFF" .. msg,getRootElement(),0,0,0,true) cancelEvent() end end addEventHandler("onPlayerChat",getRootElement(),onPlayerTalk) function stopNormalChat(msg,type) if type==0 then cancelEvent() end end addEventHandler("onPlayerChat",getRootElement(),stopNormalChat) i have Added this on the end: function stopNormalChat(msg,type) if type==0 then cancelEvent() end end addEventHandler("onPlayerChat",getRootElement(),stopNormalChat) But i'm still sending 2 messages.
  15. HeXo

    NameColor

    Wow! it's getting better. First: I send 2 messages each time i write a text. Second: I can't put the tag like [Admin] or [MoD], just [admin] and [mod] Third: If a normal player enter on the server and put my name on, he will have the red name... how can i change this things? (You should put this version on MTABeta, its alot better!)
  16. HeXo

    NameColor

    it looks better now... but im getting this error when i try to write a message: ERROR: ...mods/deathmach/resourcecache/namecolor/colorname.lua:51: attempt to concatenate local 'colors'
  17. HeXo

    NameColor

    so, can u guys help me to fix it out? i don't know so much of LUA.
  18. HeXo

    NameColor

    i have downloaded this resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=192 but i can't get it working -- ************* SPECIAL RELEASE *************** -- ************* MADE BY FATALITRY ************** -- ************* SCRIPTNAME : **************** -- ************* NAMECOLOR ***************** -- ************* A MUST HAVE FOR CLANS!! *************** function tuPlayerHasPower(player) -- Return true if the player belongs to any of the priveledged users for i,groupName in pairs({"clan"}) do if tuPlayerInACLGroup(player,groupName) then local clanAdmin = { [1]={start=1, finish=4, name="HeXo"} local clanVIP = { [1]={start=1, finish=4, name="TaTo"} } local g_Root = getRootElement() addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() local isAdmin = false for i,j in ipairs(clanAdmin) do if ( string.sub(getClientName(source), j.start, j.finish) == j.name ) then isAdmin = true end end local isVIP = falset for i,j in ipairs(clanVIP) do if ( string.sub(getClientName(source), j.start, j.finish) == j.name ) then isVIP = true end end local isMember = falset for i,j in ipairs(clanMember) do if ( string.sub(getClientName(source), j.start, j.finish) == j.name ) then isMember = true end end if ( isAdmin ) then outputChatBox("#3300FF[Admin] " .. getClientName(source) .. ': ' .. "#3300FF" .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, 0, 0, 0, true) else( isVIP ) then outputChatBox("#33FF66[Mod] " .. getClientName(source) .. ': ' .. "#FFFFFF" .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, 0, 0, 0, true) end end end ) Any ideas? Or if u guys have a better way to let the admin nick and message in RED, tell me. Sorry about my bad english.
×
×
  • Create New...