Jump to content

OrbTanT

Members
  • Posts

    226
  • Joined

  • Last visited

Everything posted by OrbTanT

  1. Still is not working, Still same problem the previous script. WARNING: [gamemodes]\[teamwar]\TeamWar\script.lua:26: Bad argument @ 'setTimer' [Expected function at argument 1, got nil]
  2. Good I am using a system of respawn player, and I'm trying to set the time to respawn after dying,more the setTimer is not working. local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875} } local spawnPlayer = function() local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(source,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3]) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler("onPlayerJoin",root,spawnPlayer) local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875} } local respawnPlayer = function() local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(source,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3]) fadeCamera(source, true) setCameraTarget(source, source) setTimer ( source, 5000 ) end addEventHandler("onPlayerWasted",root,respawnPlayer)
  3. OrbTanT

    Table Weapon

    I had forgotten this part of "giveWeapon" '-' thanks for the help
  4. OrbTanT

    Table Weapon

    Thank you, now it is working, i it had tested using "source", more I think because of onPlayerWasted was not working. one more thing, How can I set the amount of ammunition of weapons in this script?
  5. OrbTanT

    Table Weapon

    I tried to make the script work in this way, most had no results, shows the giveweapon bad argument 1. table = { {24, 26 ,31}, {24, 27, 31} } function weapon() local gRandom = math.random(#table) for placeNumber, weaponData in ipairs(table[gRandom]) do giveWeapon(player, weaponData, ammo, current) end end addEventHandler("onPlayerWasted", getRootElement(), weapon)
  6. OrbTanT

    Table Weapon

    I would like to use the math.radom , to be aleatorio the pack, when der the respawn, I don't understand much of math.random
  7. OrbTanT

    Table Weapon

    I would like to create a table, of the type that the player after that die, give spawn with one of those pack, more I am not able to create this table. pack weapon = { ( 24, 26, 31), -- weapons IDS = Desert Eagle, Sawn Off, M4 ( 24, 27, 31), -- weapons IDS = Desert Eagle, Combat Shotgun, M4 ( 24, 26, 28, 31) -- weapons IDS = Desert Eagle, Sawn Off, Uzi, M4 }
  8. OrbTanT

    countdown

    Presented error em @GetTeamName, More this has no error, and adds the score, more only for the player, for the other player shows only for him, I think that is due to "localplayer" or should give a way to add on the server. If you could get into my server would understand better just what I'm talking about, explaining is complicated
  9. OrbTanT

    countdown

    continues giving bad argument in line 46 and 48, @getTeamName
  10. OrbTanT

    countdown

    Good, i step part of team1, I mato player of team2. have to add score +1for the team1, More add to the team2. And the same thing happens with the team2, Only adds score for the team1
  11. OrbTanT

    countdown

    The script is working normal, but only has a problem, the score only account on the client, when I mato and hill to the other team, account score for the time2, more my friend helping me test was counting for the team1 only on his side.
  12. OrbTanT

    countdown

    Concerted, is now working very well the script, only had to coordinate the @getplayerteam, the dxdraw in function addEventHandler("onClientPlayerWasted", function ( killer ) local kteam = getPlayerTeam(killer) if(getTeamName(kteam) == "Team1") then Wscore = Wscore + 1 elseif(getTeamName(kteam) == "Team2") then Bscore = Bscore + 1 end end ) to: addEventHandler("onClientPlayerWasted", getRootElement(), function ( localplayer ) local team = getPlayerTeam(localPlayer) if(getTeamName(team) == "Team1") then Wscore = Wscore + 1 elseif(getTeamName(team) == "Team2") then Bscore = Bscore + 1 end end ) Thank all of you for your help
  13. OrbTanT

    countdown

    Concerted one thing and error appears in another, this time on the line, 56.57 and 59, bad among @getplayerteam , MUST be why not using a function create team? Why am I creating the team by the panel from admin to the test
  14. alguém poderia me dizer qual jeito correto de ligar o DxDrawRectangle que estou criando com um território, gostaria de deixa para abrir o DxDrawRectangle quando iniciar o ataque a o território, quando a área fica em Flashing. e se possivel também fechar o DxDrawRectangle quando o tempo acabar. client: addEventHandler("onClientRender", root, function() dxDrawRectangle(60, 320, 250, 175, tocolor(0, 0, 0, 175), true) dxDrawText("Score", 225, 325, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 365, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 405, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("TEMPO:", 70, 450, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) end ) function justForTest() end function msToTimeStr( ms ) if not ms then return '' 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 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end myTimer = setTimer( justForTest, 180*1000, 1 ) addEventHandler( "onClientRender", root, function( ) if isTimer( myTimer ) then remaining, _, _ = getTimerDetails(myTimer) remaining = msToTimeStr( remaining ) if remaining then dxDrawText( remaining, 120, 442, 350, 300, tocolor(255, 255, 255, 255), 1.0, "pricedown", "left", "top", false, false, true, false, false) end end end ) local Bscore = 0 local Wscore = 0 addEventHandler("onClientPlayerWasted", function ( killer ) local kteam = getPlayerTeam(killer) if(getTeamName(kteam) == "Team1") then Wscore = Wscore + 1 elseif(getTeamName(kteam) == "Team2") then Bscore = Bscore + 1 end end ) function onRender() local team = getPlayerTeam(localPlayer) if(getTeamName(team) == "Team1" or getTeamName(team) == "Team2") then dxDrawText("Team1:"..tostring(Bscore), 70, 340, 319, 426, tocolor(255, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Team2:"..tostring(Wscore), 70, 380, 319, 426, tocolor(0, 255, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) end end addEventHandler("onClientRender", root, onRender) server: local pArea = createRadarArea(1296.236572,2099.944335 ,100,100, 255, 255, 255,255) local pCuboid = createColCuboid(1296.236572,2099.944335 , 10, 197.5, 92, 30 ) addEventHandler("onResourceStart", resourceRoot, function() outputDebugString("Basaball", 3, 0, 255, 0) end ) addEventHandler( 'onColShapeHit', pCuboid, function( player ) if (getPlayerTeam( player )) then local pTeam = getPlayerTeam( player ) local iR, iG, iB = getTeamColor( pTeam ) local rR, gG, bB = getRadarAreaColor( pArea ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent(player, 'friendly', player) else setRadarAreaFlashing( pArea, true ) outputChatBox( "#F08080[GANGZONES] #F8F8FFA gang ".. getTeamName(getPlayerTeam(player)).." esta atacando a gang / no GANGZONE #ff0000 Basaball!",getRootElement(),255,255,255,true); triggerClientEvent(player, 'time', player) triggerClientEvent(player, 'countdown', player) pArea1Timer = setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 999); givePlayerMoney( player, 4000 ); outputChatBox( "#F08080[TERRITORIO]#F8F8FFA gang ".. getTeamName(getPlayerTeam(player)).." dominou A GANGZONE Basaball Da gang / !",getRootElement(),255,255,255,true); setRadarAreaFlashing( pArea, false ) end, 5000, 1 ) end else triggerClientEvent(player, 'group', player) end end )
  15. OrbTanT

    countdown

    Now is giving the following error: Error: pasta/client.lua:54: Bad aegument @ 'addEventHandler' [Expected element at argument 2, got function] addEventHandler("onClientRender", root, function() dxDrawRectangle(60, 320, 250, 175, tocolor(0, 0, 0, 175), true) dxDrawText("Score", 225, 325, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 365, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 405, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("TEMPO:", 70, 450, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) end ) function justForTest() end function msToTimeStr( ms ) if not ms then return '' 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 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end myTimer = setTimer( justForTest, 180*1000, 1 ) addEventHandler( "onClientRender", root, function( ) if isTimer( myTimer ) then remaining, _, _ = getTimerDetails(myTimer) remaining = msToTimeStr( remaining ) if remaining then dxDrawText( remaining, 120, 442, 350, 300, tocolor(255, 255, 255, 255), 1.0, "pricedown", "left", "top", false, false, true, false, false) end end end ) local Bscore = 0 local Wscore = 0 addEventHandler("onClientPlayerWasted", function ( killer ) local kteam = getPlayerTeam(killer) if(getTeamName(kteam) == "Team1") then Wscore = Wscore + 1 elseif(getTeamName(kteam) == "Team2") then Bscore = Bscore + 1 end end ) function onRender() local team = getPlayerTeam(localPlayer) if(getTeamName(team) == "Team1" or getTeamName(team) == "Team2") then dxDrawText("Team1:"..tostring(Bscore), 70, 340, 319, 426, tocolor(255, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Team2:"..tostring(Wscore), 70, 380, 319, 426, tocolor(0, 255, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) end end addEventHandler("onClientRender", root, onRender)
  16. OrbTanT

    countdown

    It has not yet been, still the same error that I quoted above, only this time only appears when I mato the player from the other team, and does not consider score
  17. OrbTanT

    countdown

    WARNING:pasta/client.lua:67:Bad 'team"pointer @ 'getTeamName'(1) WARNING:pasta/client.lua:67:Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got boolean]
  18. OrbTanT

    countdown

    Not going to have the server side?
  19. OrbTanT

    countdown

    Help me on something, I tried to add a score, when a team kills the player from the other team, adds +1 at score, more does not operate. client: addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(60, 320, 250, 175, tocolor(0, 0, 0, 175), true) dxDrawText("Score", 225, 325, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 365, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 405, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("TEMPO:", 70, 450, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) end ) function justForTest() end function msToTimeStr( ms ) if not ms then return '' 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 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end myTimer = setTimer( justForTest, 180*1000, 1 ) addEventHandler( "onClientRender", root, function( ) if isTimer( myTimer ) then remaining, _, _ = getTimerDetails(myTimer) remaining = msToTimeStr( remaining ) if remaining then dxDrawText( remaining, 120, 442, 350, 300, tocolor(255, 255, 255, 255), 1.0, "pricedown", "left", "top", false, false, true, false, false) end end end ) local Bscore = 0 local Wscore = 0 function onRender() local team = getPlayerTeam(localPlayer) if(getTeamName(team) == "Team1" or getTeampame(team) == "Team2") then dxDrawText("Team2", 70, 340, 319, 426, tocolor(0, 255, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Team1", 70, 380, 319, 426, tocolor(255, 0, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(tostring(Bscore), 240, 340, 319, 426, tocolor(0, 255, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(tostring(Wscore), 240, 380, 319, 426, tocolor(255, 0, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) end end addEventHandler("onClientRender", root, onRender) server: function onWasted(killer, weapon, bodypart) local kteam = getPlayerTeam(killer) if(getTeamName(kteam) == "Team1")then Wscore = Wscore + 1 elseif(getTeamName(kteam) == "Team2")then Bscore = Bscore + 1 end end addEventHandler("onClientPedWasted", getRootElement(), onWasted)
  20. OrbTanT

    countdown

    Thank you Blaawee worked perfectly, and to all who helped me
  21. OrbTanT

    countdown

    I will try to reuse this counter just like to leave it in the form of minutes.
  22. OrbTanT

    countdown

    Counter only appears when I type /counter, I'd like to leave in format of minutes. How to leave only for the counter start as soon as you open the dxdrawrectagle
  23. OrbTanT

    countdown

    I can to use this script with the dxdrawrectangle I created? addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(60, 320, 250, 175, tocolor(0, 0, 0, 175), true) dxDrawText("Score", 200, 325, 112, 356, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 365, 73, 340, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 405, 73, 340, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) dxDrawText("TEMPO:", 70, 450, 73, 340, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) end ) I put the script but does not start the counter
×
×
  • Create New...