Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. exports.scoreboard:addScoreboardColumn("Level",getRootElement(),1,40,'Level') function scoreLevel () local account = getPlayerAccount(source) local Level = getElementData(source,"Level") or 0 if isGuestAccount ( account ) then setElementData(source, "Level","ranks\0.png") else setElementData(source, "Level", ":resourceName/ranks/"..Level..".png" ) end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Level", getRootElement(), 1, 40) end ) end
  2. What is the math.rad, math.cos and math.sin? http://lua-users.org/wiki/MathLibraryTutorial
  3. -.Paradox.-

    Armor

    Maybe because someone WASN'T clear enough and post what debug says. # ZA7F helped as well
  4. -.Paradox.-

    Armor

    An 'end' is missing P: @Spider Learn LUA dude At least tell what debug says, Something like this is simple, no need to write a whole topic for it
  5. https://nightly.multitheftauto.com/files/luac_mta.exe
  6. setPedFightingStyle is server side
  7. I just put spaces? OH woah. You can't even fix a simple error. You don't even know how simple is it to fix the error. THE ERROR TELLS THAT ONE END IS MISSING SO I ADDED IT BY INDENTING THE CODE SO IT IS CLEAN. +1 He also doesn't know how to finish a string, lol.
  8. You radar have blips&radarareas support? Yes, but i'm not sharing my radar with public (sorry), I have other plans for it. Actually this one looks more realistic and cool, nice job.
  9. Really smart... Just use in the backup timer the value(time in milliseconds) that the player takes to respawn
  10. Or just change the timer value
  11. My own resources https://community.multitheftauto.com/in ... ls&id=9007 https://community.multitheftauto.com/in ... ls&id=6943 https://community.multitheftauto.com/in ... ls&id=8439 DONE
  12. function savePlayerData (thePlayer) if not (isGuestAccount (getPlayerAccount (source))) then local playeraccount = getPlayerAccount (thePlayer) if ( playeraccount ) then local x,y,z = getElementPosition (source) setAccountData (playeraccount, "save.MoneyInPocket", getPlayerMoney ( source ) ) setAccountData (playeraccount, "save.skin", tostring (getPedSkin ( source))) setAccountData (playeraccount, "save.x", x) setAccountData (playeraccount, "save.y", y) setAccountData (playeraccount, "save.z", z) setAccountData (playeraccount, "save.int", getElementInterior ( source )) setAccountData (playeraccount, "save.dim", getElementDimension ( source)) setAccountData (playeraccount, "save.rot", getPedRotation ( source)) setAccountData (playeraccount, "save.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "save.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "save.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "save.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "save.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "save.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "save.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "save.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "save.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "save.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "save.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "save.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "save.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "save.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "save.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "save.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "save.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "save.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "save.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "save.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "save.weap12", getPedWeapon ( source, 12 )) --# Classes local isPlayerInClass = getPlayerTeam( source ) if ( ( isPlayerInClass ) and not isGuestAccount( account ) ) then setAccountData(playeraccount, "save.Player.Class", getTeamName( isPlayerInClass )) end end end end addEventHandler("onPlayerQuit", root, savePlayerData); addEventHandler("onPlayerLogout", root, savePlayerData); function loadPlayerData () if not (isGuestAccount (getPlayerAccount (source))) then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerMoneyInPocket = getAccountData ( playeraccount, "save.MoneyInPocket" ) if ( playerMoneyInPocket ) then setPlayerMoney ( source, playerMoneyInPocket ) end local playerInt = getAccountData(playeraccount, "save.int") local playerDim = getAccountData(playeraccount, "save.dim") local playerSkin = getAccountData(playeraccount, "save.skin") local playerX = getAccountData(playeraccount, "save.x") local playerY = getAccountData(playeraccount, "save.y") local playerZ = getAccountData(playeraccount, "save.z") local playerRot = getAccountData(playeraccount, "save.rot") if playerX and playerY and playerZ and playerSkin then spawnPlayer(source, playerX, playerY, playerZ, playerRot, tonumber(playerSkin) ) else spawnPlayer(source,1182.04358, -2223.13159, 43.62173,math.random(0,360)) end fadeCamera (source, true) setCameraTarget (source, source) local weap0 = getAccountData(playeraccount, "save.weap0") local weap1 = getAccountData(playeraccount, "save.weap1") local weap2 = getAccountData(playeraccount, "save.weap2") local ammo2 = getAccountData(playeraccount, "save.ammo2") local weap3 = getAccountData(playeraccount, "save.weap3") local ammo3 = getAccountData(playeraccount, "save.ammo3") local weap4 = getAccountData(playeraccount, "save.weap4") local ammo4 = getAccountData(playeraccount, "save.ammo4") local weap5 = getAccountData(playeraccount, "save.weap5") local ammo5 = getAccountData(playeraccount, "save.ammo5") local weap6 = getAccountData(playeraccount, "save.weap6") local ammo6 = getAccountData(playeraccount, "save.ammo6") local weap7 = getAccountData(playeraccount, "save.weap7") local ammo7 = getAccountData(playeraccount, "save.ammo7") local weap8 = getAccountData(playeraccount, "save.weap8") local ammo8 = getAccountData(playeraccount, "save.ammo8") local weap9 = getAccountData(playeraccount, "save.weap9") local ammo9 = getAccountData(playeraccount, "save.ammo9") local weap10 = getAccountData(playeraccount, "save.weap10") local weap11 = getAccountData(playeraccount, "save.weap11") local weap12 = getAccountData(playeraccount, "save.weap12") giveWeapon ( source, weap0, 1 ) giveWeapon ( source, weap1, 1 ) giveWeapon ( source, weap2, ammo2 ) giveWeapon ( source, weap3, ammo3 ) giveWeapon ( source, weap4, ammo4 ) giveWeapon ( source, weap5, ammo5 ) giveWeapon ( source, weap6, ammo6 ) giveWeapon ( source, weap7, ammo7 ) giveWeapon ( source, weap8, ammo8 ) giveWeapon ( source, weap9, ammo9 ) giveWeapon ( source, weap10, 1 ) giveWeapon ( source, weap11, 1 ) giveWeapon ( source, weap12, 1 ) --# Classes local isPedInClass = getAccountData (playeraccount, "save.Player.Class") if ( ( isPedInClass ) and getTeamFromName( isPedInClass ) ) then setPlayerTeam(source, getTeamFromName( isPedInClass )) end end end end addEventHandler("onPlayerLogin", root, loadPlayerData) addEventHandler ("onPlayerLogin",root, function() loadStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerQuit",root, function() saveStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerLogout",root, function() saveStats( getPlayerAccount(prev)) end ) function saveStats( Acc) for i = 69 , 79 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end end function loadStats(Acc ) for i = 69 , 79 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end end
  13. function RGBToHex(red, green, blue) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then return nil end return string.format("#%.2X%.2X%.2X", red, green, blue) end local function onplayerChat ( message, messageType ) if ( messageType == 2 ) then --Team (Clan) chat cancelEvent ( ) local name = getPlayerName ( source ) local red, green, blue = getPlayerNametagColor ( source ) local hex = RGBToHex ( red, green, blue ) local team = getPlayerTeam( source ) if not team then return outputChatBox( "You are not part of a team yet !", source, 200, 100, 0) end local members = getPlayersInTeam( team ) or {} for _, player in ipairs(members) do outputChatBox( "#FF0000(CLAN)" .. hex.." "..name .. ": #FFFFFF" .. message, player, 255, 255, 255, true ) end outputServerLog( "(TEAM): " .. name .. ": " .. message ) end end addEventHandler ( "onPlayerChat", root, onplayerChat ) addCommandHandler("c", onplayerChat)
  14. function blabla(message, type) if type == 1 then cancelEvent() end end addEventHandler("onPlayerChat", root, blabla)
  15. I'm not planning to save it anymore... And your function doesn't exist
  16. oh lol, sorry i thought that is a kind of smileys
  17. fileGetSize(file) * It works, thanks, And there is one thing, How i can make it write a line everyplayer join in? Because currently it output like this Name: Test Serial: 0123456789Name: Test Serial: 0123456789
  18. I dont quietly understand, Should it be like this? local file = fileOpen(country..".txt") fileSetPos(file, 51) fileWrite(file, "Name:"..name.." Serial:"..serial) fileClose(file)
  19. Okay i won't use that, Would you please tell me what's wrong? Because i'd like to know what's wrong with it...
  20. Hey guys, I currently want to save player database using file functions, and for testing i used country as test, and actually it should write a line everytime a player login but actually it just replace it, This is my code. Server: if fileExists(country..".txt") then local file = fileOpen(country..".txt") fileWrite(file, "Name:"..name.." Serial:"..serial) fileClose(file) else local file = fileCreate(country..".txt") fileWrite(file, "Name:"..name.." Serial:"..serial) fileClose(file) end What i'm doing wrong?
  21. {"txd", "mods/m4.txd", 356}, {"dff", "mods/m4.dff", 356}, {"txd", "mods/sniper.txd", 358}, {"dff", "mods/sniper.dff", 358},
  22. Thanks, but I'm not sure if I can do this job well With great power comes great responsibility, and I wasn't sure what's what with that action that went down here But based on what I saw, I think manve1 and Grafu can take care of things, so I vote for them. I was just thinking that you or Grafu are good for this job.. Well, As you want. If you don't think you can handle this job, I'll vote for Grafu. I just saw that you're most active at the main scripting topic, that's why i voted for you
×
×
  • Create New...