Jump to content

itoko

Members
  • Content Count

    60
  • Joined

  • Last visited

Everything posted by itoko

  1. Ah yes, my bad, i didn't check the whole code at all, which is a big mistake ^^'. I guess the event should be onZombieWasted. (from what i know you're working on)
  2. function cbinds() bindKey("vehicle_fire", "down", cdoshoot) bindKey("vehicle_secondary_fire", "down", cdoshoot) bindKey("lctrl", "down", cdoshoot) bindKey("rctrl", "down", cdoshoot) allowShoots() end addEventHandler("onClientResourceStart", getRootElement(), cbinds) function cdoshoot(theVehicle) local theVehicle = getPedOccupiedVehicle(localPlayer) if bindTrigger == 1 then if not isPlayerDead(localPlayer) then bindTrigger = 0 local x,y,z = getElementPosition(theVehicle) local rX,rY,rZ = getElementRotati
  3. The conditions were kinda weird, try this: addEventHandler( "onZombieWasted", root, function ( killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 9 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ) elseif bodypart == 8 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 0.5 ) elseif bodypart == 7 and weapon == 22 then setPedStat( killer, 69, getPedStat
  4. Try this: function WeaponLevels (player, weapon) local Weapon = guiGetText(GUIEditor.label[2]) if Weapon then local Point = tonumber(Weapon) if Point >= 100 and weapon == 22 then guiSetText (GUIEditor.label[3],"Level: 1") end end end addEventHandler( "onClientRender",getRootElement(), WeaponLevels) because you maybe haven't 100 points, but more
  5. itoko

    Auto B

    i edited it try again
  6. yes, the level of water when it's raising is using untilW, but untilW never change, so the water level doesn't change.
  7. Sorry i forgot to edit it, i changed the target of the setPlayerMoney to the source.
  8. addEvent("buyGodMode", true) addEventHandler("buyGodMode", getRootElement(), function() if ( getPlayerMoney (source) >= 70000 ) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then takePlayerMoney(source, 70000) outputChatBox("Godmode Successfully activated", source, 255, 255, 0, true) setVehicleDamageProof(getPedOccupiedVehicle(source),true) setTimer( setVehicleDamageProof, 60000, 1, getPedOccupiedVehicle(source), false) else takePlayerMoney(source, 70000) outp
  9. Maybe there is something above the serverside event, that stop the addEvent, try to put the serverside event and function you showed us, in another server file (create a new one)
  10. itoko

    Auto B

    Try this: DestructionDerby = setmetatable({}, RaceMode) DestructionDerby.__index = DestructionDerby DestructionDerby:register('Destruction derby') function DestructionDerby:isApplicable() return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' end function DestructionDerby:getPlayerRank(player) return #getActivePlayers() end -- Copy of old updateRank function DestructionDerby:updateRanks() for i,player in ipairs(g_Players) do if not isPlayerFinished(player) then local rank = self:getPlayerRank(player)
  11. function money() setPlayerMoney( source, 0 ) end addEventHandler("onPlayerLogout",getRootElement(),money) Well, that depend of your script that save the money, normally yes.
  12. I guess this is what you're looking for: dxSetAspectRatioAdjustmentEnabled() https://wiki.multitheftauto.com/wiki/Dx ... entEnabled
  13. If you just want it in the corner, then don't use screen size. function Next() local x, y = guiGetScreenSize () tx = 0 ty = 10 dxDrawRectangle ( tx, ty, 130, 20, tocolor ( 0, 0, 0, 200 ) ) dxDrawColorText ("Next", tx+3, ty, tx, ty, tocolor(255,255,255,255), 1.3, "default-bold","nil","nil") end addEventHandler("onClientRender",getRootElement(),Next) But you can also make the positions relative. (divide your position by the screensize ==> tx/x ty/y and then replace the pics)
  14. You can edit the race gamemode itself, in the race_server.lua file, replace the manual spectate request function, that should be enough, i haven't tested but give it a try: -- Handle client request for manual spectate addEvent('onClientRequestSpectate', true) addEventHandler('onClientRequestSpectate', g_Root, function(enable) if checkClient( false, source, 'onClientRequestSpectate' ) then return end -- Checks if switching on local player = source if enable then if not stateAllowsManualSpectate() then return end if not _TEST
  15. itoko

    Question

    That should be enough: function main ( ) start = getTickCount() addEventHandler ("onClientRender", root, move) end bindKey ("F2","down", main) function move ( ) if not dxgui then local x = 0.5 local y = 0.5 local w = 0.6 local h = 0.6 local now = getTickCount() local elapsedTime = now - start local endtime = start + 1000 local duration = endtime - start local progress = elapsedTime / duration local w1, h1, z = interpolateBetween ( 0, 0, 0, w, h, 0, progress, "OutInBounce")
  16. At line 32 you put a coma instead of two points after source, and at line 382 you forgot to put the element before the color: -- -- toptimes_server.lua -- SToptimesManager = {} SToptimesManager.__index = SToptimesManager SToptimesManager.instances = {} --------------------------------------------------------------------------- -- Server -- Handle events from Race -- -- This is the 'interface' from Race -- --------------------------------------------------------------------------- addEvent('onMapStarting') addEventHandler('onMapStarting', g_Root, function(mapInf
  17. Ah right, little mistake i edited it
  18. Here you go: local theSerial = "" -- put the serial of the player local theCar = 411 -- put the ID of the car function randomVehColors() for _,player in ipairs(getElementsByType("player")) do if getPlayerSerial(player) == theSerial then if isPedInVehicle(player) then local car = getPedOccupiedVehicle(player) if getElementModel(car) == theCar then local color = {} color[1] = math.random(0,126) color[2] = math.random(0,126)
  19. Hope that's what you asked for: local theSerial = "putyourserialhere" function randomVehColors() for _,player in ipairs(getElementsByType("player")) do if getPlayerSerial(player) == theSerial then if isPedInVehicle(player) then local car = getPedOccupiedVehicle(player) local color = {} color[1] = math.random(0,126) color[2] = math.random(0,126) color[3] = math.random(0,126) color[4] = math.random(0,126)
  20. Just add that: addEventHandler("onClientRender",getRootElement(),text_render) at the end of this: local messages = { ["¿Que? Señor?"] = { 0, 0, 3 }, ["No hablas Español, hablas Inglés."] = { 10, 0, 3 }, ["Je ne parle pas français, je parle Néerlandais."] = { 20, 0, 3 } } function text_render ( ) for i,v in pairs ( messages ) do local x, y, z = unpack ( v ) local sx, sy, _ = getScreenFromWorldPosition ( x, y, z ) if sx then dxDrawText ( i, sx, sy, sw, sh, tocolor ( 255, 200, 0, 255 ), 1.0, "default-bold" )
  21. I checked the admin resource, and the commands are not finished yet, so there is none.
  22. Well, that is wrong: (line 59) local tieneUZI = getPedWeapon(source,5) the slot 5 is for assault rifles, and the UZI is a submachine gun, just change it to 4. local tieneUZI = getPedWeapon(source,4) Here you got the weapons and their slots: https://wiki.multitheftauto.com/wiki/Weapon
×
×
  • Create New...