Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's obviously, you don't have the value 2486 on your levels table: local levels = { [ 30 ] = 1, [ 55 ] = 2, [ 75 ] = 3, [ 85 ] = 4, [ 95 ] = 5, [ 120 ] = 6, [ 150 ] = 7, [ 230 ] = 8, [ 350 ] = 9, [ 500 ] = 10 } See? your script searches for the experience on that table, if there is, you level up.
  2. I told you to post here what did it say.
  3. exports.scoreboard:scoreboardAddColumn ( "ExP" ) exports.scoreboard:scoreboardAddColumn ( "Level" ) local levels = { [ 30 ] = 1, [ 55 ] = 2, [ 75 ] = 3, [ 85 ] = 4, [ 95 ] = 5, [ 120 ] = 6, [ 150 ] = 7, [ 230 ] = 8, [ 350 ] = 9, [ 500 ] = 10 } addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) addPlayerZombieKills ( killer ) end ) function addPlayerZombieKills ( killer ) local account = getPlayerAccount ( killer ) if isGuestAccount ( account ) then return end local H = tonumber ( getElementData ( killer, "ExP" ) ) or 0 outputChatBox ( "Cur experience: ".. tostring ( H ) ) setElementData ( killer, "ExP", tonumber ( H ) + 5 ) local H = ( H + 5 ) outputChatBox ( "New experience: ".. tostring ( H ) ) if ( levels [ H ] ) then setElementData ( killer, "Level", "lvl ".. tostring ( levels [ H ] ) .." !" ) triggerClientEvent ( killer, "playSound", killer ) else outputChatBox ( "No level for experience: ".. tostring ( H ) ) end end function onLogin ( _, account ) setElementData ( source, "Level", getAccountData ( account, "lvl" ) or "Level 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 ) Try that and tell me what does it output to chat box.
  4. Should work, are you logged in?
  5. Works fine here, post your meta.xml.
  6. You must download the latest version, is all explained on the description: https://community.multitheftauto.com/ind ... ls&id=1152
  7. I've tested your script first, it seemed to work, although, I made some changes. -- client side: function levelup ( ) if isElement ( expLabel ) then destroyElement ( expLabel ) end local Exp = getElementData ( localPlayer, "ExP" ) local Level = getElementData ( localPlayer, "Level" ) expLabel = guiCreateLabel ( 0.777, 0.22, 0.1708, 0.0963, "ExP gained: ??\nTotal ExP: ".. tostring ( Exp ) .."\nLevel: ".. tostring ( Level ), true ) guiLabelSetColor ( expLabel, 0, 255, 0 ) guiLabelSetVerticalAlign ( expLabel, "top" ) guiLabelSetHorizontalAlign ( expLabel, "left", false ) guiSetFont ( expLabel, "clear-normal" ) setTimer ( levelup, 2000, 1 ) end setTimer ( levelup, 2000, 1 ) -- server side: exports.scoreboard:scoreboardAddColumn ( "ExP" ) exports.scoreboard:scoreboardAddColumn ( "Level" ) local levels = { [ 30 ] = 1, [ 55 ] = 2, [ 75 ] = 3, [ 85 ] = 4, [ 95 ] = 5, [ 120 ] = 6, [ 150 ] = 7, [ 230 ] = 8, [ 350 ] = 9, [ 500 ] = 10 } addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) addPlayerZombieKills ( killer ) end ) function addPlayerZombieKills ( killer ) local account = getPlayerAccount ( killer ) if isGuestAccount ( account ) then return end local H = tonumber ( getElementData ( killer, "ExP" ) ) or 0 setElementData ( killer, "ExP", tonumber ( H ) + 5 ) local H = ( H + 5 ) if ( levels [ H ] ) then setElementData ( killer, "Level", "lvl ".. tostring ( levels [ H ] ) .." !" ) triggerClientEvent ( killer, "playSound", killer ) end end function onLogin ( _, account ) setElementData ( source, "Level", getAccountData ( account, "lvl" ) or "Level 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 )
  8. I don't understand what are you trying to do, but, local flagElements = getElementsByType ( "tdm" ) -- loop through them for key, value in ipairs(flagElements) do -- get our info local posX = getElementData ( value, "posX" ) local posY = getElementData ( value, "posY" ) local posZ = getElementData ( value, "posZ" ) end That should be fine to get all 'tdm'.
  9. Well, it should work if your experience is on the table.
  10. You are talking about the "race" rankingboard I guess, that's scripted with GUI, you can't enable the HEX colours that easy, but you could enable the nick name colors by setting the label color.
  11. function stopDancingEvent() setPedAnimation(source) end addEvent("stopDancing",true) addEventHandler("stopWalking",getRootElement(),stopDancingEvent)
  12. Yeah, I'd a typo, copy the code again.
  13. -- loool -- blips function blips ( ) createBlip ( 1713.02, 917.98, 10.80, 27 ) -- mechanic createBlip ( 1381.99, 1019.81, 10.82, 51 ) -- store storeMarker = createMarker ( 1374.50, 1020, 12.5, 'arrow', 2.5, 72, 118, 255, 250 ) mechMarker = createMarker ( 1713, 913, 12.0, 'arrow', 2.0, 72, 118, 255, 250 ) mechMarkerBack = createMarker ( 2333.10, -1077.7, 1050.02, 'arrow', 2.0, 72, 118, 255, 250 ) setElementInterior ( mechMarkerBack, 6) gunInsideMech = createPickup (2342.25, -1063.91, 1049.02, 2, 22, 3000 ) -- Pistol inside mech house setElementInterior ( gunInsideMech, 6) armorInsideMech = createPickup (2340.25, -1063.91, 1049.02, 1, 100, 3000) -- Armor inside mech house setElementInterior ( armorInsideMech, 6) end addEventHandler ( "onResourceStart", resourceRoot, blips ) -- markers function MarkerHit ( thePlayer, matchingDimension ) local elementType = getElementType ( thePlayer ) if ( elementType == "player" and not isPedInVehicle ( thePlayer ) ) then if ( source == storeMarker ) then outputChatBox ( "You hit the marker", thePlayer, 255,0,0 ) givePlayerMoney ( thePlayer, 5000 ) elseif ( source == mechMarker ) then outputChatBox ( "You entered the safe house.", thePlayer, 255,0,0 ) setElementInterior ( thePlayer, 6, 2333.0330, -1073.9600, 1049.0230 ) elseif ( source == mechMarkerBack ) then outputChatBox ( "You left the safe house.", thePlayer, 255,0,0 ) setElementInterior ( thePlayer, 0, 1713.02, 917.98, 10.80 ) end end end addEventHandler ( "onMarkerHit", root, MarkerHit ) Try that.
  14. Tenes un lio con los 'if' y 'else'. addEvent ( "cuenta", true ) addEventHandler ( "cuenta", root, function ( username, password, passwordConfirm ) if ( password ~= "" and password ~= nil and username ~= "" and username ~= nil and password == passwordConfirm ) then if ( not getAccount ( username ) ) then local accountAdded = addAccount ( username, password ) if ( accountAdded ) then outputChatBox ( "Gracias " .. getPlayerName ( source ) .. ", Ya estas Registrado y loggeado", source ) outputChatBox ( "Tu Character se a creado con exito !.", source ) triggerClientEvent ( source, "closeGUI", source ) logIn ( source, username , password ) else outputChatBox ( "Error creando la Cuenta por Favor contacta a un Admin.", source ) end else outputChatBox ( "Esta Cuenta Ya Existe..", source ) end else outputChatBox ( "Porfavor Pon tus datos Correctos.", source ) end end ) function loginHandler(username,password) if ( username ) then local acc = getAccount(username, password) if (acc) then logIn ( source, acc, password ) fadeCamera(source, true) setCameraTarget(source) triggerClientEvent ( source, "closeGUI", source ) outputChatBox("Disfrutalo", source) else outputChatBox("invalid username and password. Please re-connect and try again.", source) end end end addEvent("submitLoginEM",true) addEventHandler("submitLoginEM",root, loginHandler)
  15. Talvez si dieras mas informacion te podriamos ayudar.
  16. You can use this way: -- blips function blips ( ) createBlip ( 1713.02, 917.98, 10.80, 27 ) -- mechanic createBlip ( 1381.99, 1019.81, 10.82, 51 ) -- store storeMarker = createMarker ( 1374.50, 1020, 12.5, 'arrow', 2.5, 255, 136, 0, 250 ) mechMarker = createMarker ( 1713, 913, 12.0, 'arrow', 2.0, 255, 136, 0, 250 ) mechMarkerBack = createMarker ( 2333.17, -1075.96, 1049.02, 'arrow', 2.0, 255, 136, 0, 250 ) setElementInterior ( mechMarkerBack, 6, 2333.17, -1075.96, 1049.02 ) end addEventHandler ( "onResourceStart", resourceRoot, blips ) -- markers function MarkerHit ( thePlayer, matchingDimension ) local elementType = getElementType ( thePlayer ) if ( elementType == "player" ) then if ( source == storeMarker ) then outputChatBox ( "You hit the marker", thePlayer, 255,0,0 ) givePlayerMoney ( thePlayer, 5000 ) elseif ( source == mechMarker ) then outputChatBox ( "You hit the marker", thePlayer, 255,0,0 ) setElementInterior ( thePlayer, 6, 2333.0330, -1073.9600, 1049.0230 ) elseif ( source == mechMarkerBack ) then outputChatBox ( "You hit the marker", thePlayer, 255,0,0 ) setElementInterior ( thePlayer, 0, 1713.02, 917.98, 10.80 ) end end end addEventHandler ( "onMarkerHit", root, MarkerHit )
  17. You must set the marker interior as well.
  18. Eso no es cancelar un disparo, eso es desabilitar el control de disparo.
  19. The effect could be done via scripting, but I don't know how hard would it be. To "teleport" to an interior you must use: setElementInterior
  20. No door, I just seen the arrow floating in air.
  21. Castillo

    PHP y LUA

    Tenes errores muy basicos en Lua aun, no te recomiendo intentar hacer algo como esto.
  22. I went to the marker and it worked, the game mode is not something that could cause it not to work.
  23. Well, I cannot be right at everything, can I? he has no right to insult me because of a SIMPLE mistake.
  24. I didn't fail to read, I know about the min version attribute. And please get a better attitude if you don't want to get in trouble.
×
×
  • Create New...