Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    209

Everything posted by IIYAMA

  1. (text) cause it is client. Fire must work, unless your position is incorrect. function DeeJay () outputChatBox ( "#ffffffAve !", 255, 255, 255, true ) -- getRootElement() <<<< outputChatBox ( "#ffffffActual Year: 0 !", 255, 255, 255, true ) -- getRootElement() <<<< createFire ( -1972.8114013672, -4087.1137695313, 53.04610824585, 1.8 ) end addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), DeeJay )
  2. Rockstar Games\GTA San Andreas\models gta3.img use txd workshop to find them. (they are included with all other texture from the weapon)
  3. fu operator, updated.
  4. Saw another mistake, the new xp wasn't calculated for the leveling, but only for the elementdata. Of course in time it would be come correct, but it would not logistic. It have to be done within the locals. Tell me if something doesn't work, I did not really test it. Based on logistic. exports.scoreboard:scoreboardAddColumn("Level") local levels = { {100,1}, {200,2}, {300,3}, {400,4}, {500,5}, {1000,6}, {2500,7}, {5000,8}, {7000,9}, {10000,10}, {15000,11}, {20000,12}, {30000,13}, {55000,14}, {65000,15} } local getLevel = function (xp,level) for i=level,#levels do local position = levels[i] if xp >= position[1] then local position2 = levels[i+1] if position2 and xp < position2[1] then -- this is for the future when you are going to give more xp. return position[2] end else return false -- he didn't reached the next level. end end end function win(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local H = tonumber(getElementData(killer, "ExP")) or 0 local S = getElementData(killer, "Level") or 0 local killer1 = getPlayerName(killer) local noob = getPlayerName(source) local newXP = H+math.random ( 10, 80 ) -- new xp, for the elementdata and level finder. setElementData(killer, "ExP", newXP ) if S < #levels then -- stop doing things when he reached max level local newLevel = getLevel(newXP,S+1) if newLevel and newLevel ~= S then setElementData(killer, "Level", "Lvl ".. tostring(newLevel) .." ! ") triggerClientEvent ( killer, "playSound", killer ) end end end local H = tonumber (getElementData ( source, "ExP" )) or 0 setElementData ( source, "ExP", H - math.random ( 5, 50 ) ) end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "0") setElementData(source, "ExP", getAccountData(account, "exp") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) local saveData = function (thePlayer, theAccount) if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "lvl", getElementData(thePlayer, "Level")) setAccountData (theAccount, "exp", getElementData(thePlayer, "ExP")) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (prev) saveData(source, prev) end)
  5. Maybe you should first test it. exports.scoreboard:scoreboardAddColumn("Level") local levels = { {100,1}, {200,2}, {300,3}, {400,4}, {500,5}, {1000,6}, {2500,7}, {5000,8}, {7000,9}, {10000,10}, {15000,11}, {20000,12}, {30000,13}, {55000,14}, {65000,15} } local getLevel = function (xp,level) for i=level,#levels do local position = levels[i] if xp => position[1] then return position[2] end end end function win(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local H = getElementData(killer, "ExP") or 0 local S = getElementData(killer, "Level") or 0 local killer1 = getPlayerName(killer) local noob = getPlayerName(source) setElementData(killer, "ExP", tonumber(H)+math.random ( 10, 80 ) ) local newLevel = getLevel(H,S+1) if newLevel and newLevel ~= S then setElementData(killer, "Level", "Lvl ".. tostring(newLevel) .." ! ") triggerClientEvent ( killer, "playSound", killer ) end end local H = getElementData ( source, "ExP" ) or 0 setElementData ( source, "ExP", tonumber ( H ) - math.random ( 5, 50 ) ) end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "0") setElementData(source, "ExP", getAccountData(account, "exp") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) function saveData(thePlayer, theAccount) if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "lvl", getElementData(thePlayer, "Level")) setAccountData (theAccount, "exp", getElementData(thePlayer, "ExP")) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (prev) saveData(source, prev) end)
  6. it is, as long you can script. Else no, then you wasted my time.
  7. Like as sample: local levels = { {100,1}, {200,2}, {300,3}, {400,4}, {500,5}, {1000,6}, {2500,7}, {5000,8}, {7000,9}, {10000,10}, {15000,11}, {20000,12}, {30000,13}, {55000,14}, {65000,15} } local getLevel = function (xp) for i=1,#levels do local position = levels[i] if xp => position[1] then return position[2] end end end -- getLevel(xp) You also can create your own index start number to save cpu power.
  8. Because it only should work when his level is exp is 100 and exact 200.... + math.random( 10, 80 ) logistic... loop the table and compare and when you find the right information, break it. -_-"
  9. The element type of this class is "player". As you said: "player", you should know that. The one that writes down the command, it is server side. If I may did something wrong, say it clearly,,,
  10. A sample of increasing hp with a hp limit. local healthUpdate = 10 local maxHealth = 100 addCommandHandler("testhealth", function(player) local currentHealth = getElementHealth(player) local newHealth = currentHealth+healthUpdate if newHealth < maxHealth then setElementHealth (player,newHealth) elseif currentHealth ~= maxHealth then -- data transfer saver. setElementHealth (player,maxHealth) end end)
  11. function ( ) local eop = getPedStat ( source, 75 ) setPedStat (source, 75, eop + 500 ) end addEventHandler("onPlayerSpawn", root, ) WIKI mta: onPlayerSpawn This event is called when a player spawns. Parameters float posX, float posY, float posZ, float spawnRotation, team theTeam, int theSkin, int theInterior, int theDimension posX: The X position the player spawned at posY: The Y position the player spawned at posZ: The Z position the player spawned at spawnRotation: The rotation the player spawned with theTeam: The team the player spawned with theSkin: The skin / model the player spawned with theInterior: The interior the player spawned in theDimension: The dimension the player spawned in Source The source of this event is the player that just spawned.
  12. IIYAMA

    blip table :3

    no really required. The index counts up from 1 t/m amount of data. If the value is lower then 13 then only the first one will be triggered. etc. It is just logic of elseif.... that is saving your server power, btw now you have double blips: if index <= 12 then if index >= 12 and index <= 24 then if index >= 24 and index <= 34 then if index <= 12 then if index > 12 and index <= 24 then if index > 24 and index <= 34 then
  13. IIYAMA

    question

    setElementVisibleTo ( theMarker, root, false ) local teamHuntPlayers = getPlayersInTeam (teamhunt) for i=1,#teamHuntPlayers do setElementVisibleTo ( theMarker,teamHuntPlayers[i], true ) end or create markers at client side. Maybe better.
  14. IIYAMA

    question

    https://wiki.multitheftauto.com/wiki/Se ... tVisibleTo
  15. IIYAMA

    question

    I don't understand the problem. Markers only for one team? and gui will be visible when a player joins?
  16. To answer your question, you can't. The function from itoko, can fix the position of your custom hud/image in combination with the original hud.
  17. IIYAMA

    blip table :3

    You mean something like this? for index,blip in pairs(blips) do local x, y, z = blip[1], blip[2], blip[3] if index <= 12 then local blipizza = createBlip ( x, y, z, 29, 0.5, 0 ,0, 0, 0, 0, 400 ) setBlipSize ( blipizza, 0.5 ) elseif index <= 24 then local blipcluckinbell = createBlip ( x, y, z, 14, 0.5, 0 ,0, 0, 0, 0, 400 ) setBlipSize ( blipcluckinbell, 0.5 ) elseif index <= 34 then local blipburgershot = createBlip ( x, y, z, 10, 0.5, 0 ,0, 0, 0, 0, 400 ) setBlipSize ( blipburgershot, 0.5 ) end end
  18. IIYAMA

    Scores?

    simply elementdata. https://wiki.multitheftauto.com/wiki/SetElementData post your code or send the part that is broken, then I will take a look tomorrow. Good forum night.
  19. Why would we? This only shows us how lazy you are.
  20. red line thingy or real colshape? For the red lines there are settings in the menu to enable them. Bounding box or something like that. What do you want to config with the edf? The water will be set from the meta settings.
  21. local sx, sy = guiGetScreenSize ( ) local LastTick = 1000 local DXToRender = 0 addEventHandler ( "onClientRender", root, function ( ) local lc = getTickCount ( ) if ( lc-LastTick >= 1000 ) then LastTick = lc DXToRender = 30 end if DXToRender > 0 then dxDrawText ( lc, 0, 0, sx, sy, tocolor ( 202, 202, 202, 255 ), 3, "default-bold", "center", "center" ) DXToRender = DXToRender-1 end end ) You forgot to set how many frames it have to render.
  22. lol? new function? thank you
  23. why would you do: cancelEvent() I see no reason to do that for these lines. When the event got executed it is already to late for this function.
×
×
  • Create New...