Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. drk

    Nametag

    function Spectate.Render() local screenWidth, screenHeight = guiGetScreenSize() if Spectate.Render == true then --local TextWidth = dxGetTextWidth( string.gsub ( "Currently spectating:", '#%x%x%x%x%x%x', '' ), 0.55, "default-bold" ) --dxDrawColorText( string.gsub ( "#60f8ffCurrently spectating:", '#%x%x%x%x%x%x', '#000000' ) , 1+screenWidth/2-TextWidth/2, 1+screenHeight-120, 1+screenWidth/2-TextWidth/2, 1+screenHeight-120, tocolor(0, 0, 0, 255), 0.55, "default-bold" ) --dxDrawColorText( "#60f8ffCurrently spectating:" , screenWidth/2-TextWidth/2, screenHeight-120, screenWidth/2-TextWidth/2, screenHeight-120, tocolor(255, 255, 255, 255), 0.55, "default-bold" ) if Spectate.TargetPlayer then local r,g,b = 255,255,255 local team = getPlayerTeam(Spectate.TargetPlayer) if team then r,g,b = getTeamColor(team) end local TargetWidth = dxGetTextWidth( string.gsub ( _getPlayerName(Spectate.TargetPlayer), '#%x%x%x%x%x%x', '' ), 0.46, "bankgothic" ) local TargetHeight = dxGetFontHeight( 0.55, "bankgothic" ) dxDrawColorText( string.gsub ( _getPlayerName(Spectate.TargetPlayer), '#%x%x%x%x%x%x', '#000000' ) , 1+screenWidth/3.8-TargetWidth/6.25, 1+screenHeight-99+TargetHeight, 1+screenWidth/2-TargetWidth/2, 1+screenHeight-120+TargetHeight, tocolor(0, 0, 0, 255), 0.55, "bankgothic" ) dxDrawColorText( _getPlayerName(Spectate.TargetPlayer) , screenWidth/3.8-TargetWidth/6.25, screenHeight-99+TargetHeight, screenWidth/2-TargetWidth/2, screenHeight-120+TargetHeight, tocolor(r, g, b, 255), 0.55, "bankgothic" ) --vehicle health local vehHealth = getElementHealth(getPedOccupiedVehicle(Spectate.TargetPlayer)) if vehHealth then local health = math.max(health - 250, 0)/750 local r = -510*(health^2) local g,b = math.max(math.min(r+255*health+255,255),0), math.max(math.min(p+765*health,255),0) dxDrawRectangle(screenWidth-587,screenHeight-63,screenWidth-726,screenHeight-587,math.floor(200*(health)),tocolor(g,b,0,getElementAlpha(Spectate.TargetPlayer)),false) end else local NoOneWidth = dxGetTextWidth( string.gsub ( "No one to spectate", '#%x%x%x%x%x%x', '' ), 0.55, "bankgothic" ) local NoOneHeight = dxGetFontHeight( 0.55, "bankgothic" ) dxDrawColorText( string.gsub ( "#FFFFFFNo one to spectate", '#%x%x%x%x%x%x', '#000000' ), 1+screenWidth/4-NoOneWidth/6, 1+screenHeight-90+NoOneHeight, 1+screenWidth/2-NoOneWidth/2, 1+screenHeight-120+NoOneHeight, tocolor(0, 0, 0, 255), 0.55, "bankgothic" ) dxDrawColorText( "#FFFFFFNo one to spectate", screenWidth/4-NoOneWidth/6, screenHeight-90+NoOneHeight, screenWidth/2-NoOneWidth/2, screenHeight-120+NoOneHeight, tocolor(255, 255, 255, 255), 0.55, "bankgothic" ) end if Spectate.active and Spectate.savePos then --local JoinWidth = dxGetTextWidth( string.gsub ( "Press 'B' to join", '#%x%x%x%x%x%x', '' ), 0.55, "default-bold" ) --local JoinHeight = dxGetFontHeight( 0.55, "default-bold" ) --dxDrawColorText( string.gsub ("#FFFFFFPress #ffffff'B'#FFFFFF to join", '#%x%x%x%x%x%x', '' ), 1+screenWidth/4-JoinWidth/6, 1+screenHeight-90+JoinHeight*3, 1+screenWidth/2-JoinWidth/2, 1+screenHeight-120+JoinHeight*3, tocolor(0, 0, 0, 255), 0.55, "default-bold" ) --dxDrawColorText( "#FFFFFFPress #ffffff'B'#60f8ff to join", screenWidth/4-JoinWidth/6, screenHeight-90+JoinHeight*3, screenWidth/2-JoinWidth/2, screenHeight-120+JoinHeight*3, tocolor(255, 255, 255, 255), 0.55, "default-bold" ) end end end addEventHandler("onClientRender", g_Root, Spectate.Render) I get this error: "Cannot perform arithmetic on global 'health' ( a nil value )"
  2. drk

    Nametag

    I've solved the problem but the bar not appear.
  3. drk

    Nametag

    Ah, local screenWidth, screenHeight = guiGetScreenSize() and it is on onClientRender event. I will solve getElementAlpha problem .
  4. drk

    Nametag

    --vehicle health local vehHealth = getElementHealth(getPedOccupiedVehicle(localPlayer)) if vehHealth then local health = math.max(health - 250, 0)/750 local r = -510*(health^2) local g,b = math.max(math.min(r+255*health+255,255),0), math.max(math.min(p+765*health,255),0) dxDrawRectangle(screenWidth-587,screenHeight-63,screenWidth-726,screenHeight-587,math.floor(256-256*(health)),tocolor(g,b,0,getElementAlpha(vehHealth)),false) end Why don't appear anything in the screen? It is anything wrong?
  5. drk

    Interval is below 50

    Thaaanks veeeery much. It worked D:
  6. drk

    Interval is below 50

    It don't output anything and I don't get any error now. Only don't play songs.
  7. LOL Hosting mta sa on webhost oO How you do that? Say to me how pls '-' :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:
  8. LOL, majdy, try reinstalling mta sa and see a youtube video how to create a mta sa server...
  9. moveObject D: https://wiki.multitheftauto.com/wiki/moveObject
  10. drk

    Interval is below 50

    arezu, thanks. now I don't get any error but the song don't plays. the table: local musicURL = { 'http://199.167.195.178/wdga.mp3', 'http://199.167.195.178/pd.mp3', 'http://199.167.195.178/vlv.mp3', 'http://199.167.195.178/dk.mp3', 'http://199.167.195.178/tw.mp3', 'http://199.167.195.178/bh-aiew.mp3', 'http://199.167.195.178/wk-bay.mp3', 'http://199.167.195.178/sx-mnis.mp3', 'http://199.167.195.178/ib-sotg.mp3', 'http://199.167.195.178/mc-flm.mp3', 'http://199.167.195.178/ctm-gd.mp3', 'http://199.167.195.178/tv.mp3', 'http://199.167.195.178/wttc.mp3', 'http://199.167.195.178/iml.mp3', 'http://199.167.195.178/ctwykm.mp3', 'http://199.167.195.178/e-ksb9rx.mp3', 'http://199.167.195.178/Lights.mp3', 'http://199.167.195.178/nod.mp3', 'http://199.167.195.178/atb-yana.mp3' } the code: addEventHandler('onClientResourceStart',resourceRoot, function() local random = musicURL[math.random(1,#musicURL)] local currentSound = playSound(random,false); end); addEventHandler('onClientElementDestroy', root, function() if (source == currentSound) then local random = musicURL[math.random(1,#musicURL)] local currentSound = playSound(random,false); end; end); I've tried with local random = musicURL[math.random(#musicURL)] too but it don't play.
  11. You want to when a player buys nitro and an admin types /fine it appears in the chat and the player is fined? How you want to player is fined?
  12. drk

    Interval is below 50

    Ive used 'random' but I get 'Cannot ... arithmetic on a bolean value' Edit: Ok, now I get 'Expected element at argument 2, got bolean' in the same line
  13. drk

    Interval is below 50

    No one try to help ?
  14. drk

    Interval is below 50

    currentSound is defined by playSound ( random, false ); . random is: local random = musicURL[math.random(#musicURL)]
  15. drk

    Interval is below 50

    setTimer(playSound,getSoundLength(currentSound),80,random); I get the same error, Im doing something wrong?
  16. drk

    Interval is below 50

    Aww shit School is fucking me :@
  17. Hey all I'm trying to set a timer to execute 'playSound ( random )' when a sound stops. It starts a music. But in debugscript I see an error: 'setTimer' interval is below 50 on line 108. Line 108: setTimer(playSound,getSoundLength(currentSound)*1000,80,random); I don't see the problem, the interval is 1 and then I get the error, i've tried with 50,51 and 80 and I get the same error. Why ?
  18. Just don't copy other people's ideas/scripts It is very bad for your reputation to even admit you're trying to do so But then again, there must be a reason why you keep changing your name. And yes, it's very obvious because you always keep the picture Dude, I change the nick here because I change in MTASA and I don't want to change the picture, now you understand? Stop acting like a noob ( if you isn't a ) And if you don't want to help or if you don't know don't say nothing. Edit: And I don't want to copy TG ideas. All race DM servers have a music player ^^
  19. Or include all in one, JR10: bindKey('F1','down', function() guiSetVisible(window,not guiGetVisible(window)) showCursor(guiGetVisible(window)) end) Why he needs a command to bind F1? .-.
  20. I don't understand what you want in this function and these events.
  21. drk

    Infopanel..

    You have to create a function to save the text in the script.
  22. Ah variable name cant be used for adding a row because is used for the table . Im noob all the days Thanks.
×
×
  • Create New...