-
Posts
1,050 -
Joined
-
Last visited
Everything posted by ViRuZGamiing
-
I know how to draw but how to correctly loop as mine is wrong.
-
I tried this but didn't work; for _, player in ipairs ( getPlayerPing( thePlayer ) ) do dxDrawText ( getPlayerPing( thePlayer ), ping_X, name_Y, name_X * 1.2, name_Y * 1.2, tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) name_Y = ( name_Y + text_h * 1.5 ) end
-
LOL, maybe something went wrong with copying but indeed it works now. Can I also do this; for _, player in ipairs ( getElementsByType ( "player" ) ) do dxDrawText ( getPlayerName ( player ), name_X, name_Y, name_X * 1.2, name_Y * 1.2, tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) name_Y = ( name_Y + text_h * 1.5 ) end For Ping?
-
The name is still behind the rectangle
-
local text_h = dxGetFontHeight(1,"bankgothic") addEventHandler("onClientRender",root, function () local name_X = 350 local team_X = 700 local ping_X = 950 local name_Y = 200 local namend_Y = 700 if not getKeyState("tab") then return end dxDrawRectangle(250, 100, 800, 600, tocolor(0, 100, 255, 150), true) dxDrawText("Belgium-Reallife", 250, 100, 1050, 200, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true, false, false) dxDrawLine(250, 200, 1050, 200, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(550, 200, 550, 700, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(850, 200, 850, 700, tocolor(255, 255, 255, 255), 1, true) --dxDrawText("Team1", 550, 200, 850, 700, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) --dxDrawText("Ping1", 850, 200, 1050, 700, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) if name_Y > namend_Y then return end for i,player in pairs(getElementsByType("player")) do dxDrawText(getPlayerName(player),name_X,name_Y,name_X*1.2,name_Y*1.2,tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) name_Y = name_Y + text_h*1.5 end end) This is what I got, it works but the text is drawed behind the rectangle, how to fix?
-
It's fixed, by end I ment end the mp3. did it with onClientVehicleExit.
-
As title says, local dubstepSound = { "sounds/1.mp3", "sounds/2.mp3", } local sound = nil local keyBoundedDubStep = false local lastTrack = nil local controlDubstepClient = function (playState) if not isElement(sound) then local dubstepSound = dubstepSound if lastTrack then table.remove(dubstepSound,lastTrack) end sound = playSound(dubstepSound[ math.random( #dubstepSound )]) elseif playState then setSoundPaused (sound,not isSoundPaused ( sound )) end end local dubstepClient = function () if not keyBoundedDubStep then bindKey ( "M", "down", controlDubstepClient,true) keyBoundedDubStep = true end if isElement(sound) then stopSound(sound) end sound = playSound(dubstepSound[ math.random( #dubstepSound )]) end addEvent("dubstepPlay", true) addEventHandler("dubstepPlay", root, dubstepClient) addEventHandler ( "onClientSoundStopped", root, function (reason) if reason == "finished" then local dubstepSound = dubstepSound if lastTrack then table.remove(dubstepSound,lastTrack) end sound = playSound(dubstepSound[ math.random( #dubstepSound )]) end end)
-
Can I just do setPlayerTeam(thePlayer, pTeam)
-
@bandi94 can I connect you over skype (chat not call)
-
Bandi I will try some stuff out 'as I know you are very experienced with dxDrawings' and post the code in here.
-
It doesn't need to be better, I want to have a scoreboard having an Image instead of an Rectangle, and no setting button also.
-
How do you mean? can you give me an example?
-
Here's the code -- Define spawn local spawnX, spawnY, spawnZ = -1976.7485351563, 883.75982666016, 45.203125 -- Save function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then setAccountData ( playeraccount, "s.HandMoney", getPlayerMoney ( source )) setAccountData (playeraccount, "s.skin", getElementModel (source )) local team = getPlayerTeam(source) setAccountData (playeraccount, "s.team", getTeamName (team)) setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end local pSkin = getAccountData (playeraccount, "s.skin") local pTeam = getAccountData (playeraccount, "s.team") local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") giveWeapon ( source, weap0, 1 ) giveWeapon ( source, weap1, 1 ) giveWeapon ( source, weap2, ammo2 ) giveWeapon ( source, weap3, ammo3 ) giveWeapon ( source, weap4, ammo4 ) giveWeapon ( source, weap5, ammo5 ) giveWeapon ( source, weap6, ammo6 ) giveWeapon ( source, weap7, ammo7 ) giveWeapon ( source, weap8, ammo8 ) giveWeapon ( source, weap9, ammo9 ) giveWeapon ( source, weap10, 1 ) giveWeapon ( source, weap11, 1 ) giveWeapon ( source, weap12, 1 ) end end ) -- Functions function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) setElementRotation(source, 0, 0, -270) fadeCamera(source, true) setCameraTarget(source, source) end function regMoney() givePlayerMoney( source, 1000 ) end function allPlayersPayDay() local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do givePlayerMoney ( value, 500 ) outputChatBox ( "---- Payday ----") outputChatBox ( "You've earned €500") outputChatBox ( "----------------") end end function onResourceStart(thisResource) setTimer ( allPlayersPayDay, 600000, 0 ) end -- Events addEventHandler("onPlayerLogin", getRootElement(), joinHandler) addEventHandler("onPlayerRegister", getRootElement(), regMoney) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResourceStart ) I get my money, guns, etc... but my team and skin isn't saved
-
Does this enter everyname? Like Name1 Name2 instead of Name1Name2
-
Another thing; getPlayerName gets only 1 name, right? I need every player on the scoreboard.
-
Thx, Btw nice avatar.
-
Okay, So i know this, pName = getPlayerName (thePlayer) pPing = getPlayerPing(thePlayer) acc = getPlayerAccount(thePlayer) if acc and not isGuestAccount(acc) then team = getPlayerTeam(thePlayer) if team then setAccountData(acc, "team", getTeamName(team)) Playtime I will figure out but how to draw this data on a dxDrawRectangle?
-
Debug: expected number at 4 (screenH)
-
function showLoginlogo () local screenW, screenH = guiGetScreenSize() showLogo = guiCreateStaticImage ( 0, 0, screenW, ScreenH, "images/logoscreen.png") end addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() ), showLoginlogo ) still not visible
-
Hi, This is the first time i'm creating an image function showLoginlogo () local screenW, screenH = guiGetScreenSize() showLogo = guiCreateStaticImage ( 0, 0, screenW, ScreenH, "images/logoscreen") end addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() ), showLoginlogo ) Why doesn't this work? I want the picture to fill the screen.
-
fadeCamera is wrong, Required Arguments thePlayer: The player whose camera you wish to fade. fadeIn: Should the camera be faded in our out? Pass true to fade the camera in, false to fade it out to a color. after the required fill in the optional. You have 2 values infront of the source, (fadeCamera, source, true, --optionals...)
-
Hello, Tell me what I need to make a scoreboard from scratch with username, group, playtime and ping
-
It's awesome!! Please bring in the level system, i love nfs world but you can give this mta copy of it a twist by adding cops which aren't npc's.
-
Yes and i didn't, because I knew you would scam, You don't have Paypal or Visa and don't pay!
-
@TAPL throw his please of the forum he will contact more and more people he just scammed me too, I'm glad i've readed this and knew it.
