Jump to content

itoko

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by itoko

  1. As far as i know, you can't aim while an animation is running. (i might be wrong and just not know how to) So if you really want to be able to aim while doing an animation, you should make your own aiming system, using createWeapon and stuff.
  2. My bad, on the error you said "_", and it was actually "-", not exactly the same, so i didn't look at the script. In your script, one of the variables is named tieneTec-9, but the server reads it like tieneTec - 9, like maths you know. So you can replace it by tieneTec_9: marcadorTienda = createMarker(2285.8000488281,549.59997558594,6.8000001907349,"cylinder",1.5,0,125,250,153) function mostrarTienda(hitPlayer) triggerClientEvent(hitPlayer,"mostrarTienda",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marcadorTienda,mostrarTienda) addEvent ("comproColt-45", true) addEventHandler ("comproColt-45", getRootElement(), function (id, cost,munic) if (getPlayerMoney (source) >= tonumber(cost)) then outputChatBox ("Congratulations!,You Bought a colt", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source, tonumber (id),tonumber (munic)) else outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false) end end) addEvent ("comproShotgun", true) addEventHandler ("comproShotgun", getRootElement(), function (id, cost,munic) if (getPlayerMoney (source) >= tonumber(cost)) then outputChatBox ("Congratulations!,You bought a Shotgun", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source, tonumber (id),tonumber (munic)) else outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false) end end) addEvent ("comproTec-9", true) addEventHandler ("comproTec-9", getRootElement(), function (id, cost,munic) if (getPlayerMoney (source) >= tonumber(cost)) then outputChatBox ("Congratulations!,You bought a Tec-9", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source, tonumber (id),tonumber (munic)) else outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false) end end) addEvent ("comproUZI", true) addEventHandler ("comproUZI", getRootElement(), function (id, cost,munic) if (getPlayerMoney (source) >= tonumber(cost)) then outputChatBox ("Congratulations!,You bought a UZI", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source, tonumber (id),tonumber (munic)) else outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false) end end) addEvent ("comproMunicionUZI", true) addEventHandler ("comproMunicionUZI", getRootElement(), function (id, cost,munic) local tieneUZI = getPedWeapon(source,5) if (getPlayerMoney (source) >= tonumber(cost)) and (tieneUZI == 28) then outputChatBox ("Congratulations!,you bought a UZI ammo", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source,tonumber(id),tonumber(munic)) elseif (getPlayerMoney (source) >= tonumber(cost)) and (tieneUZI ~= 28) then outputChatBox ("Ehm,I think you forgot to buy the UZI First -.-", source, 255, 0, 0, false) elseif (getPlayerMoney (source) < tonumber(cost)) and (tieneUZI == 28) then outputChatBox ("No money? Go kill some zombies", source, 255, 0, 0, false) else outputChatBox ("Ehm,I think you forgot to buy the UZI First -.-", source, 255, 0, 0, false) end end) addEvent ("comproMunicionTec-9", true) addEventHandler ("comproMunicionTec-9", getRootElement(), function (id, cost,munic) local tieneTec_9 = getPedWeapon(source,4) if (getPlayerMoney (source) >= tonumber(cost)) and (tieneTec_9 == 32) then outputChatBox ("Congratulations!,You bought a Tec-9 Ammo", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source,tonumber(id),tonumber(munic)) elseif (getPlayerMoney (source) >= tonumber(cost)) and (tieneTec_9 ~= 32) then outputChatBox ("Ehm,I think you forgot to buy the Tec-9 First -.-", source, 255, 0, 0, false) elseif (getPlayerMoney (source) < tonumber(cost)) and (tieneTec_9 == 32) then outputChatBox ("No money? Go kill some zombies", source, 255, 0, 0, false) else outputChatBox ("Ehm,I think you forgot to buy the Tec-9 First -.-", source, 255, 0, 0, false) end end) addEvent ("comproMunicionShotg", true) addEventHandler ("comproMunicionShotg", getRootElement(), function (id, cost,munic) local tieneShotgun = getPedWeapon(source,3) if (getPlayerMoney (source) >= tonumber(cost)) and (tieneShotgun == 25) then outputChatBox ("Congratulations,You bought a shotgun ammo", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source,tonumber(id),tonumber(munic)) elseif (getPlayerMoney (source) >= tonumber(cost)) and (tieneShotgun ~= 25) then outputChatBox ("Ehm,I think you forgot to buy the Shotgun First -.-", source, 255, 0, 0, false) elseif (getPlayerMoney (source) < tonumber(cost)) and (tieneShotgun == 25) then outputChatBox ("No money? Go kill some zombies.", source, 255, 0, 0, false) else outputChatBox ("Ehm,I think you forgot to buy the Shotgun First -.-", source, 255, 0, 0, false) end end) addEvent ("comproMunicionColt-45", true) addEventHandler ("comproMunicionColt-45", getRootElement(), function (id, cost,munic) local tieneColt-45 = getPedWeapon(source,2) if (getPlayerMoney (source) >= tonumber(cost)) and (tieneColt-45 == 22) then outputChatBox ("Congartulations,You bought a Colt ammo", source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost)) giveWeapon(source,tonumber(id),tonumber(munic)) elseif (getPlayerMoney (source) >= tonumber(cost)) and (tieneColt-45 ~= 22) then outputChatBox ("Ehm,I think you forgot to buy the Colt First -.-", source, 255, 0, 0, false) elseif (getPlayerMoney (source) < tonumber(cost)) and (tieneColt-45 == 22) then outputChatBox ("No money? Go kill some zombies", source, 255, 0, 0, false) else outputChatBox ("Ehm,I think you forgot to buy the Colt First -.-", source, 255, 0, 0, false) end end) addEventHandler("onResourceStart",getRootElement(), function () outputChatBox("Gunshop by LiOneLMeSsI") end ) Once again, read the error and you should be able to fix it yourself.
  3. Well, from what you are giving us, i can't find the error you're saying. I think you forgot to give us the right script which is the file "tienda_sv.lua".
  4. Learn to read properly the errors written in the debugsmode. It's telling you there are errors with the events and it even tell you the line. From what i got, you want only one marker so you removed the createMarker, but you also have to remove the events that are triggering the markers you removed: local bank1 = createMarker ( 2290.8999023438, 537.09997558594, 0.80000001192093, "cylinder", 1.5, 255, 0, 0, 170 ) local bankBlip1 = createBlip ( 2290.8999023438, 537.09997558594, 0.80000001192093, 52, 2, 0, 0, 0, 255, 0, 15, getRootElement()) addEvent("CLBankGUI", true) addEvent("DepozytBank", true) addEvent("WyplacBank", true) addEvent("onSendVars", true) addEvent("potrzebujeBankBalance", true) addEvent("otoBalans", true) addEvent("chatBank", true) function bankHit(thePlayer) outputChatBox("Welcome to Zombie Island Bank system", thePlayer, 255, 0, 0) triggerClientEvent ("CLBankGUI", getRootElement()) end addEventHandler( "onMarkerHit", bank1, bankHit ) function DepozytDoBanku(amount) if not (tonumber(amount) <= 0) then local bankBalance = getAccountData (getPlayerAccount (source), "clroleplay-bank") takePlayerMoney(source, amount) amount2 = bankBalance + amount setAccountData (getPlayerAccount (source), "clroleplay-bank", amount2) outputChatBox("Your bank balance: " .. amount2 .. "$!", source, 255, 255, 0) else outputChatBox("Don't try to deposit " .. amount .. "$! =]", source, 255, 0, 0) end end addEventHandler( "DepozytBank", getRootElement(), DepozytDoBanku ) function potrzebaBalansu() local balans = getAccountData (getPlayerAccount (source), "clroleplay-bank") --New player anty-bug if(tostring(balans) == "false" or tostring(balans) == "")then setAccountData (getPlayerAccount (source), "clroleplay-bank", 0) balans = getAccountData (getPlayerAccount (source), "clroleplay-bank") end triggerClientEvent ("otoBalans", getRootElement(), balans) end addEventHandler( "potrzebujeBankBalance", getRootElement(), potrzebaBalansu ) function chatBank() local balans = getAccountData (getPlayerAccount (source), "clroleplay-bank") triggerClientEvent ("bankBalanceChat", getRootElement(), balans) end addEventHandler( "chatBank", getRootElement(), chatBank ) function WyplacZBanku(amount) local BankCash = getAccountData (getPlayerAccount (source), "clroleplay-bank") if (tonumber(amount) <= tonumber(BankCash)) then if(tonumber(amount) >= 1) then amount2 = BankCash-amount setAccountData (getPlayerAccount (source), "clroleplay-bank", amount2) givePlayerMoney(source, amount) outputChatBox("Your bank balance: " .. amount2 .. "$!", source, 255, 255, 0) else outputChatBox("Withdrawing " .. amount .. "$ is impossible!", source, 255, 0, 0) end else outputChatBox("You entered wrong value!", source, 255, 0, 0) outputChatBox("Your bank balance is " .. BankCash .. "$!", source, 255, 0, 0) end end addEventHandler( "WyplacBank", getRootElement(), WyplacZBanku ) Try to understand the debugmode, it's helpfull.
  5. You should try making it by yourself, here's what you'll need: addCommandHandler() setAccountData() getAccountData() and this can be usefull https://wiki.multitheftauto.com/wiki/Ge ... omNamePart
  6. in a table, you must put a coma after each argument, except for the last one, try this: local levels = {[1] = 1, [50] = 2, [75] = 3, [240] = 4, [950] = 5, [1200] = 6, [2000] = 7, [5000] = 8, [9963] = 9, [20000] = 10, [40000] = 11, [60000] = 12, [75000] = 13, [95000] = 14, [110000] = 15, [120000] = 16, [130000] = 17, [145000] = 18, [165000] = 19, [200000] = 20}
  7. The problems are probably from the onZombieWasted event, i checked the resource, and even if this event is similar to onPlayerWasted, it's not the same. The arguments are wrong in your win function, the onZombieWasted event doesn't inform about the ammo: function win(ammo, killer, weapon, bodypart) --------------- -- change to --------------- function win(killer, weapon, bodypart) Now it should work fine
  8. Actually, to use a parachute you have to run the parachute resource, that resource bind the key to fire, and it seems like bindKey doesn't work with setControlState. So what you can do is edit the parachute resource, and add an event to run the function that will open the parachute, and trigger the event instead of setting the control state. parachute_cl.lua : (simply added requestOpenParachute event) FALL_VELOCITY = 0.9 -- how fast you have to be going (z) before you stop landing properly and just hit the ground MIN_GROUND_HEIGHT = 20 -- how high above the ground you need to be before parachuting will start local y_turn_offset = 20 -- limits how far to the sides the player will lean when turning left or right local rotation_accelerate = 0.5 -- speed at which the player will lean when turning slowfallspeed = -0.07 -- fall speed with legs up fallspeed = -0.15 -- fall speed with legs down haltspeed = 0.02 movespeed = 0.2 -- horizontal speed turnspeed = 1.5 -- rotation speed when turning lastspeed = 0 opentime = 1000 local lastAnim = {} local lastTick local removing = false local g_parachuters = {} local function onResourceStart ( resource ) bindKey ( "fire", "down", onFire ) bindKey ( "enter_exit", "down", onEnter ) end addEventHandler ( "onClientResourceStart", resourceRoot, onResourceStart ) local function onRender ( ) lastTick = lastTick or getTickCount() local currentTick = getTickCount() local tickDiff = currentTick - lastTick lastTick = currentTick if tickDiff > 0 then if ( getElementData ( localPlayer, "parachuting" ) ) then if ( changeVelocity ) then velX, velY, velZ = getElementVelocity ( localPlayer ) if ( not isPedOnGround ( localPlayer ) and not getPedContactElement ( localPlayer ) and velZ ~= 0) then _,rotY,rotZ = getElementRotation ( localPlayer ) rotZ = -rotZ local currentfallspeed = s(fallspeed) local currentmovespeed = s(movespeed) if ( getMoveState ( "backwards" ) ) then currentfallspeed = s(slowfallspeed) end -- going too fast, slow down to appropriate speed if ( velZ < currentfallspeed ) then if ( lastspeed < 0 ) then if ( lastspeed >= currentfallspeed ) then velZ = currentfallspeed else velZ = lastspeed + s(haltspeed) end end -- going too slow, speed back up to appropriate speed elseif ( velZ > currentfallspeed ) then velZ = currentfallspeed if lastspeed <= velZ then currentmovespeed = currentmovespeed / 2 end end lastspeed = velZ local dirX = math.sin ( math.rad ( rotZ ) ) local dirY = math.cos ( math.rad ( rotZ ) ) velX = dirX * currentmovespeed velY = dirY * currentmovespeed if ( velZ == currentfallspeed ) then if ( getMoveState ( "backwards" ) ) then setPedNewAnimation ( localPlayer, "animation_state", "PARACHUTE", "PARA_decel", -1, false, true, false ) if getMoveState ( "left" ) then rotZ = rotZ - a(turnspeed,tickDiff) if y_turn_offset > rotY then rotY = rotY + a(rotation_accelerate,tickDiff) end elseif getMoveState ( "right" ) then rotZ = rotZ + a(turnspeed ,tickDiff) if -y_turn_offset < rotY then rotY = rotY - a(rotation_accelerate,tickDiff) end elseif 0 > math.floor(rotY) then rotY = rotY + a(rotation_accelerate,tickDiff) elseif 0 < math.floor(rotY) then rotY = rotY - a(rotation_accelerate,tickDiff) end elseif ( getMoveState ( "left" ) ) then rotZ = rotZ - a(turnspeed,tickDiff) if y_turn_offset > rotY then rotY = rotY + a(rotation_accelerate,tickDiff) end setPedNewAnimation ( localPlayer, "animation_state", "PARACHUTE", "PARA_steerL", -1, false, true, false ) elseif ( getMoveState ( "right" ) ) then rotZ = rotZ + a(turnspeed ,tickDiff) if -y_turn_offset < rotY then rotY = rotY - a(rotation_accelerate,tickDiff) end setPedNewAnimation ( localPlayer, "animation_state", "PARACHUTE", "PARA_steerR", -1, false, true, false ) else setPedNewAnimation ( localPlayer, "animation_state", "PARACHUTE", "PARA_float", -1, false, true, false ) if 0 > math.floor(rotY) then rotY = rotY + a(rotation_accelerate,tickDiff) elseif 0 < math.floor(rotY) then rotY = rotY - a(rotation_accelerate,tickDiff) end end setPedRotation ( localPlayer, -rotZ ) setElementRotation ( localPlayer,0,rotY, rotZ ) end setElementVelocity ( localPlayer, velX, velY, velZ ) else if velZ >= FALL_VELOCITY then --they're going to have to fall down at this speed removeParachute(localPlayer,"land") setPedAnimation(localPlayer,"PARACHUTE","FALL_skyDive_DIE", t(3000), false, true, true) else removeParachute(localPlayer,"land") setPedNewAnimation ( localPlayer, nil, "PARACHUTE", "PARA_Land", t(3000), false, true, false ) end end end local posX,posY,posZ = getElementPosition(localPlayer) if testLineAgainstWater ( posX,posY,posZ + 10, posX,posY,posZ) then --Shoot a small line to see if in water removeParachute(localPlayer,"water") setPedNewAnimation ( localPlayer, nil, "PARACHUTE", "PARA_Land_Water", t(3000), false, true, true ) end end end --Render remote players for player,t in ipairs(g_parachuters) do if player ~= localPlayer and getElementData ( player, "parachuting" ) and isElementStreamedIn(player) then local velX,velY,velZ = getElementVelocity ( player ) local rotz = 6.2831853071796 - math.atan2 ( ( velX ), ( velY ) ) % 6.2831853071796 local animation = getElementData ( player, "animation_state" ) setPedNewAnimation ( player, nil, "PARACHUTE", animation, -1, false, true, false ) local _,rotY = getElementRotation(player) --Sync the turning rotation if animation == "PARA_steerL" then if y_turn_offset > rotY then rotY = rotY + rotation_accelerate end elseif animation == "PARA_steerR" then if -y_turn_offset < rotY then rotY = rotY - rotation_accelerate end else if 0 > math.floor(rotY) then rotY = rotY + rotation_accelerate elseif 0 < math.floor(rotY) then rotY = rotY - rotation_accelerate end end setElementRotation ( player, 0, rotY, -math.deg(rotz) ) end end end addEventHandler ( "onClientRender", root, onRender ) function onFire ( key, keyState ) if ( not getElementData ( localPlayer, "parachuting" ) ) and getElementData(localPlayer,"skydiving") then local x,y,z = getElementPosition(localPlayer) if not processLineOfSight ( x,y,z, x,y,z-MIN_GROUND_HEIGHT, true, true,false,true,true,false,false,false,localPlayer ) then stopSkyDiving() addLocalParachute() addEventHandler ( "onClientPlayerWasted", localPlayer, onWasted ) end end end addEvent("requestOpenParachute",true) addEventHandler("requestOpenParachute",getRootElement(),onFire) function onEnter () if ( getElementData ( localPlayer, "parachuting" ) ) then removeParachute(localPlayer,"water") setPedAnimation(localPlayer) end end function onWasted() removeParachute(localPlayer,"water") setPedAnimation(localPlayer) setPedAnimation(localPlayer,"PARACHUTE","FALL_skyDive_DIE", t(3000), false, true, false) end function addLocalParachute() local x,y,z = getElementPosition ( localPlayer ) local chute = createObject ( 3131, x,y,z ) setElementDimension(chute, getElementDimension( localPlayer ) ) setElementStreamable(chute, false ) openChute ( chute, localPlayer, opentime ) setElementData ( localPlayer, "parachuting", true ) triggerServerEvent ( "requestAddParachute", localPlayer ) end function removeParachute(player,type) if player == localPlayer then if removing then return end removing = true end local chute = getPlayerParachute ( player ) setTimer ( setPedAnimation, t(3000), 1, player ) openingChutes[chute] = nil if chute then if type == "land" then Animation.createAndPlay( chute, {{ from = 0, to = 100, time = t(2500), fn = animationParachute_land }} ) setTimer ( function() detachElements ( chute, player ) setTimer ( destroyElement, t(3000), 1, chute ) end, t(2500), 1 ) elseif type == "water" then Animation.createAndPlay( chute, {{ from = 0, to = 100, time = t(2500), fn = animationParachute_landOnWater }} ) setTimer ( destroyElement, t(2500), 1, chute ) end end lastAnim[player] = nil if player == localPlayer then divingTick = 0 divingSpeed = nil lastspeed = math.huge toggleControl ( "next_weapon", true ) toggleControl ( "previous_weapon", true ) changeVelocity = false setElementData ( localPlayer, "animation_state", nil ) setTimer ( setElementData, 1000, 1, localPlayer, "parachuting", false ) setTimer ( function() removing = false end, 1100, 1) removeEventHandler ( "onClientPlayerWasted", localPlayer, onWasted ) triggerServerEvent ( "requestRemoveParachute", localPlayer ) end end function animationParachute_land(chute,xoff) setElementAttachedOffsets ( chute, offset[1],offset[2],offset[3], math.rad(xoff), 0, 0 ) end function animationParachute_landOnWater(chute,xoff) setElementAttachedOffsets ( chute, offset[1],offset[2],-xoff/10, math.rad(xoff), 0, 0 ) end addEvent ( "doAddParachuteToPlayer", true) addEventHandler ( "doAddParachuteToPlayer", root, function() local x,y,z = getElementPosition ( source ) local chute = createObject ( 3131, x, y, z )
  9. hmm maybe you could manage to set the object position instead of attaching it
  10. You can also use this race i edited: viewtopic.php?f=108&t=43277&p=436482#p436482 Just replace your race in the resource folder
  11. itoko

    Map unloading

    Thank you for replying. I looked into the map manager, and i found nothing about this problem, this resource simply start/stop map resource. Actually my "shootermap" isn't affected by this, as i load the map in another resource, plus i have the same problem if i load the map using createObject as script. I tested something, i made the shootermap in the dimension 0, and the map doesn't disappear, so this problem seems to occur only when it's in another dimension. Pretty strange, maybe a particularity from the startResource function?
  12. itoko

    Map unloading

    Hello, I need help for something. So i edited the race gamemode to be able to warp a player in another dimension, on a special map (shooter map). I also managed to make it possible to stay on this map as long as you want, even on race map change you stay there. The only problem is that when a race map is started(loaded), the shooter map disappear, or unload. The player is still in the same dimension, but the map simply unload. Also when i rewarp the player in the dimension, the map reappear. I looked in the racemap.lua of the race gamemode and the rest of the mode, but it seems like i can't find why it always unload the map. I don't know if it is really from the race mode unloading every maps on mapchange, or if it's from another script. So here's the problem, how could i stop this map unloading on my shooter map ? I hope this is understandable, if you need any precision to help me, write it. Thanks in advance.
  13. I think you could check if the element is a player by using getElementType, i haven't tested it, but give it a try: function send(text) triggerClientEvent(root, "onSendChat", source, text) end addEventHandler("onPlayerChat", root, send) function onChatMessageHandler(text, element) if isElement(element) then cancelEvent() else if ( getElementType ( element) ~= "player" ) then triggerClientEvent("onSendChat", root, text) cancelEvent() end end end addEventHandler("onChatMessage", root, onChatMessageHandler)
  14. Add a little timer in server to let the client add the event before triggering it setTimer(function() triggerClientEvent("onDriver", resourceRoot, conductor) end,100,1)
  15. itoko

    createProjectile

    I tested this again with someone else and it works.
  16. itoko

    createProjectile

    You have to get a proper link, it has to be directly the song file, not a music player or so, like http://yourlink/song.mp3 I found this one for your music: http://srv2.youtump3.com/get.php?video_ ... t-KH3oIIcU
  17. itoko

    createProjectile

    Can you give me the link? I tested the script on my server, and it worked fine, even with a radio link
  18. itoko

    createProjectile

    Hmm, do you execute the command correctly? Don't forget to give the url you are using in playSound3D(url, x, y, z) like /url song.mp3
  19. itoko

    createProjectile

    I presume this is in client? so it execute the script only on your pc, you should make the commandHandler in server, and trigger the client function.
  20. Yes, you are actually cancelling the wrong event, which cause to cancel the map starting i guess.
  21. I actually get this problem when the image is at the limit of the screen, move it just a little from it and it should be fixed. Not sure if it will work.
  22. Hi, this is just some changes i've made to the default race, i saw many recorders asking how to disable healthbar, timers ect so i've done some functions to do that. Don't tell me it's bad scripted ect cuz i don't care it works. [-]Use commands: - /toggle hud - toggle healthbar, speedbar and timers - /toggle all - toggle Everythings [-]Use keys: - Press 'h' to toggle healthbar, speedbar and timers - Press 'n' to toggle everythings [-]Download: Click Here
  23. Hi, i'd like to present our new map with pawlo, it took long time to release this map, but it is finally here, enjoy, rate and comment! 720p is advised Map is available on ~AG~ and ~[EPG]~ Servers
×
×
  • Create New...