Jump to content

Sex*

Members
  • Posts

    455
  • Joined

  • Last visited

Everything posted by Sex*

  1. Well this doesnt function: function ResetModel ( ) engineRestoreModel ( 411 ) end addEvent ( "restoreClientModel", true ) addEvent( "onClientMapStarting", true ) addEventHandler ( "restoreClientModel", getRootElement(), ResetModel ) addEventHandler("onClientMapStarting",getRootElement(), ResetModel) addEventHandler ( "onClientResourceStart", getResourceRootElement(), ResetModel )
  2. Sex*

    Closed

    And how can i trust you?
  3. And that scripter also told that setAccountData and getAccountData would be better. But how much? Is setAccountData and getaccountData without XML and the saving works after server restart? And yes im using XML right now.
  4. Ok, the loadplayerdata and saveplayerdata some parts, actually all the script has loadplayerdata and saveplayerdata in everything.: function newLevelSystem(thePlayer) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) if not (playerLevel == 41) then if (playerCash >= levelPrices[playerLevel+1]) then savePlayerData(thePlayer,"cash",playerCash-levelPrices[playerLevel+1]) savePlayerData(thePlayer,"level",playerLevel+1) if (playerLevel+1 > 25) then outputChatBox("#ff4000*#FFFFFFCongratulations#ff4000!#FFFFFF You are now level #ff4000["..specialLevelNames[playerLevel-24].."]#FFFFFF!",thePlayer,255,255,255,true) outputChatBox("#ff4000*[ #FFFFFF"..getPlayerName(thePlayer).."#ff4000]#FFFFFF has levelled up! He/She is now level#FF0000 "..specialLevelNames[playerLevel-24].."#FFFFFF!",getRootElement(),255,255,255,true) else outputChatBox("#0000ff* #FFFFFFCongratulations#0000ff!#FFFFFF You are now level #ABCDEF"..playerLevel+1 .."#FFFFFF!",thePlayer,255,255,255,true) outputChatBox("#0000ff* #FFFFFF"..getPlayerName(thePlayer).."#FFFFFF has levelled up! He/She is now level#FF0000 "..playerLevel+1 .."#FFFFFF!",getRootElement(),255,255,255,true) end else outputChatBox("#0000ff* #FFFFFFYou need another #ABCDEF$"..levelPrices[playerLevel+1]-playerCash.."#FFFFFF to advance to the next level!",thePlayer,255,255,255,true) levelAchievements(thePlayer) return false end else outputChatBox("#0000ff* #FFFFFFYou have reached the maximum possible level! #0000ff[#FFFFFF Level 25 #FFFF00ELITE #0000ff]",thePlayer,255,255,255,true) return false end local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) if (playerLevel == 25) then outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff-------------------------------------",thePlayer,255,255,255,true) outputChatBox("#0000ff* #FFFFFFYou have reached level #FF000025#FFFFFF!",thePlayer,255,255,255,true) outputChatBox("#0000ff* #FFFFFFYou can now start again from level 10 in #FFFF00ELITE #FFFFFFmode!",thePlayer,255,255,255,true) outputChatBox("#0000ff-------------------------------------",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) elseif (playerLevel == 26) then outputChatBox("#0000ff* #FFFFFFYou now earn more money from winning and setting new top hunter times!",thePlayer,255,255,255,true) elseif (playerLevel == 41) then outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff---------------------------------------",thePlayer,255,255,255,true) outputChatBox("#0000ff* Congratulations on reaching level #0000ff ELITE#0000ff!",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) outputChatBox("#0000ff* You have reached the maximum level!",thePlayer,255,255,255,true) outputChatBox("#0000ff---------------------------------------",thePlayer,255,255,255,true) outputChatBox("#0000ff",thePlayer,255,255,255,true) end scoreboardRefresh(thePlayer) refreshStats(thePlayer) progressBarUpdate(thePlayer) levelAchievements(thePlayer) end function refreshStats(thePlayer) local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local unlockedAchievements = tonumber(loadPlayerData(thePlayer,"unlockedAchievements")) local totalTimesJoined = tonumber(loadPlayerData(thePlayer,"totalTimesJoined")) local mapsWon = tonumber(loadPlayerData(thePlayer,"mapsWon")) local mapsPlayed = tonumber(loadPlayerData(thePlayer,"mapsPlayed")) local totalHunters = tonumber(loadPlayerData(thePlayer,"totalHunters")) local totalToptimes = tonumber(loadPlayerData(thePlayer,"totalToptimes")) local totalMoneyEarned = tonumber(loadPlayerData(thePlayer,"totalMoneyEarned")) local totalMoneySent = tonumber(loadPlayerData(thePlayer,"totalMoneySent")) local totalBets = tonumber(loadPlayerData(thePlayer,"totalBets")) local totalBetsEarned = tonumber(loadPlayerData(thePlayer,"totalBetsEarned")) local totalBetsWon = tonumber(loadPlayerData(thePlayer,"totalBetsWon")) local totalDeaths = tonumber(loadPlayerData(thePlayer,"totalDeaths")) local totalPlayingTimeMinutes = tonumber(loadPlayerData(thePlayer,"totalPlayingTimeMinutes")) local totalPlayingTimeHours = tonumber(loadPlayerData(thePlayer,"totalPlayingTimeHours")) local totalReactionTests = tonumber(loadPlayerData(thePlayer,"totalReactionTests")) local bestReactionTime = tonumber(loadPlayerData(thePlayer,"bestReactionTime")) levelImage = getRankingImage(playerLevel) levelDisplay = getEliteName(playerLevel) local winRatio = 0 if mapsPlayed == 0 and mapsWon == 0 then winRatio = 0 elseif mapsPlayed ~= 0 and mapsWon == 0 then winRatio = 0 elseif mapsPlayed ~= 0 and mapsWon ~= 0 then winRatio = math.round(((100/mapsPlayed)*mapsWon),2) elseif mapsWon > mapsPlayed then winRatio = 0 end callClientFunction(thePlayer,"refreshStats",levelDisplay,levelImage,playerCash,unlockedAchievements,totalTimesJoined,mapsWon,mapsPlayed,winRatio,totalHunters,totalToptimes,totalMoneyEarned,totalMoneySent,totalBets,totalBetsEarned,totalBetsWon,totalDeaths,totalPlayingTimeMinutes,totalPlayingTimeHours,totalReactionTests,bestReactionTime) end function checkForFirstTimeJoined(thePlayer) local joinedBefore = tonumber(loadPlayerData(thePlayer,"joinedBefore")) if joinedBefore == 0 then callClientFunction(callClientFunction,1000,1,thePlayer,"performSettingsUpdate") savePlayerData(thePlayer,"joinedBefore",1) outputChatBox("#ff4000*#FF0000Welcome to The Proffessionals, #ff4000[#ffffff"..getPlayerName(thePlayer.."#ff4000]#FFFFFF!",thePlayer,255,255,255,true)) end end function getDataOnStart(thePlayer) local pName = loadPlayerData(thePlayer,"pName") local pAge = loadPlayerData(thePlayer,"pAge") local pEmail = loadPlayerData(thePlayer,"pEmail") local pMsn = loadPlayerData(thePlayer,"pMsn") local pSkype = loadPlayerData(thePlayer,"pSkype") local pXfire = loadPlayerData(thePlayer,"pXfire") local pICQ = loadPlayerData(thePlayer,"pICQ") local pXBL = loadPlayerData(thePlayer,"pXBL") callClientFunction(thePlayer,"setDataOnStart",pName,pAge,pEmail,pMsn,pSkype,pXfire,pICQ,pXBL) end function getPersonalDetails(requestingPlayer,thePlayerName) local thePlayer = findPlayerByName(thePlayerName) local allowPersonalDetails = loadPlayerData(thePlayer,"allowPersonalDetails") if allowPersonalDetails == tostring(true) or tonumber(allowPersonalDetails) == 0 then local pName = loadPlayerData(thePlayer,"pName") local pAge = loadPlayerData(thePlayer,"pAge") local pEmail = loadPlayerData(thePlayer,"pEmail") local pMsn = loadPlayerData(thePlayer,"pMsn") local pSkype = loadPlayerData(thePlayer,"pSkype") local pXfire = loadPlayerData(thePlayer,"pXfire") local pICQ = loadPlayerData(thePlayer,"pICQ") local pXBL = loadPlayerData(thePlayer,"pXBL") callClientFunction(requestingPlayer,"displayPersonalDetails",pName,pAge,pEmail,pMsn,pSkype,pXfire,pICQ,pXBL) else outputChatBox("#0000ff* #FFFFFFThe other player has disabled viewing his personal details!",requestingPlayer,255,255,255,true) end end function getPlayerRaceStats(requestingPlayer,thePlayerName) local thePlayer = findPlayerByName(thePlayerName) local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local unlockedAchievements = tonumber(loadPlayerData(thePlayer,"unlockedAchievements")) local totalTimesJoined = tonumber(loadPlayerData(thePlayer,"totalTimesJoined")) local mapsWon = tonumber(loadPlayerData(thePlayer,"mapsWon")) local mapsPlayed = tonumber(loadPlayerData(thePlayer,"mapsPlayed")) local totalHunters = tonumber(loadPlayerData(thePlayer,"totalHunters")) local totalToptimes = tonumber(loadPlayerData(thePlayer,"totalToptimes")) local totalMoneyEarned = tonumber(loadPlayerData(thePlayer,"totalMoneyEarned")) local totalMoneySent = tonumber(loadPlayerData(thePlayer,"totalMoneySent")) local totalBets = tonumber(loadPlayerData(thePlayer,"totalBets")) local totalBetsEarned = tonumber(loadPlayerData(thePlayer,"totalBetsEarned")) local totalBetsWon = tonumber(loadPlayerData(thePlayer,"totalBetsWon")) local totalDeaths = tonumber(loadPlayerData(thePlayer,"totalDeaths")) local totalPlayingTimeMinutes = tonumber(loadPlayerData(thePlayer,"totalPlayingTimeMinutes")) local totalPlayingTimeHours = tonumber(loadPlayerData(thePlayer,"totalPlayingTimeHours")) end function getPlayerStats(triggeringPlayer,thePlayer) local allowStats = loadPlayerData(thePlayer,"allowStats") if allowStats == tostring(true) or tonumber(allowStats) == 0 then local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local unlockedAchievements = tonumber(loadPlayerData(thePlayer,"unlockedAchievements")) local totalTimesJoined = tonumber(loadPlayerData(thePlayer,"totalTimesJoined")) local mapsWon = tonumber(loadPlayerData(thePlayer,"mapsWon")) local mapsPlayed = tonumber(loadPlayerData(thePlayer,"mapsPlayed")) local totalHunters = tonumber(loadPlayerData(thePlayer,"totalHunters")) local totalToptimes = tonumber(loadPlayerData(thePlayer,"totalToptimes")) local totalMoneyEarned = tonumber(loadPlayerData(thePlayer,"totalMoneyEarned")) local totalMoneySent = tonumber(loadPlayerData(thePlayer,"totalMoneySent")) local totalBets = tonumber(loadPlayerData(thePlayer,"totalBets")) local totalBetsEarned = tonumber(loadPlayerData(thePlayer,"totalBetsEarned")) local totalBetsWon = tonumber(loadPlayerData(thePlayer,"totalBetsWon")) local totalDeaths = tonumber(loadPlayerData(thePlayer,"totalDeaths")) local totalPlayingTimeMinutes = tonumber(loadPlayerData(thePlayer,"totalPlayingTimeMinutes")) local totalPlayingTimeHours = tonumber(loadPlayerData(thePlayer,"totalPlayingTimeHours")) local totalReactionTests = tonumber(loadPlayerData(thePlayer,"totalReactionTests")) local bestReactionTime = tonumber(loadPlayerData(thePlayer,"bestReactionTime")) levelImage = getRankingImage(playerLevel) levelDisplay = getEliteName(playerLevel) local winRatio = 0 if mapsPlayed == 0 and mapsWon == 0 then winRatio = 0 elseif mapsPlayed ~= 0 and mapsWon == 0 then winRatio = 0 elseif mapsPlayed ~= 0 and mapsWon ~= 0 then winRatio = math.round(((100/mapsPlayed)*mapsWon),2) elseif mapsWon > mapsPlayed then winRatio = 0 end callClientFunction(triggeringPlayer,"displayPersonalStats",thePlayer,levelDisplay,levelImage,playerCash,unlockedAchievements,totalTimesJoined,mapsWon,mapsPlayed,winRatio,totalHunters,totalToptimes,totalMoneyEarned,totalMoneySent,totalBets,totalBetsEarned,totalBetsWon,totalDeaths,totalPlayingTimeMinutes,totalPlayingTimeHours,totalReactionTests,bestReactionTime) else outputChatBox("#0000ff* #FFFFFFThe other player has disabled viewing his stats!",triggeringPlayer,255,255,255,true) end end function buyMap(thePlayer,mapName) local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) addEvent("onScriptSetNextMap",true) addEventHandler("onScriptSetNextMap",getRootElement(), function (mapName) thePlayer = source local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) function getClientSettings(thePlayer) a = loadPlayerData(thePlayer,"allowPersonalDetails") b = loadPlayerData(thePlayer,"allowStats") c = loadPlayerData(thePlayer,"useCustomNametag") d = loadPlayerData(thePlayer,"useCustomSkin") e = loadPlayerData(thePlayer,"useCustomVehicleColor") f = loadPlayerData(thePlayer,"soundMessage") g = loadPlayerData(thePlayer,"soundRequest") h = loadPlayerData(thePlayer,"showOnDeath") i = loadPlayerData(thePlayer,"useHunterSkin") j = loadPlayerData(thePlayer,"chatAcceptMode") callClientFunction(thePlayer,"configureOptions",true,a,b,c,d,e,f,g,h,i,j) end function showUserpanelOnDeath() if (loadPlayerData(source,"showOnDeath") == "true") then callClientFunction(source,"displayUserpanel") end function saveNametagColor(thePlayer,r,g,b) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) savePlayerData(thePlayer,"cash",playerCash-nametagPrice) savePlayerData(thePlayer,"nametagRed",r) savePlayerData(thePlayer,"nametagGreen",g) savePlayerData(thePlayer,"nametagBlue",b) setNametagColor(thePlayer) outputChatBox("#*#FFFFFFYou have purchased a new nametag color for #ABCDEF$"..nametagPrice.."#FFFFFF!",thePlayer,255,255,255,true) savePlayerData(thePlayer,"everPurchasedNametagColor",1) setElementData(thePlayer,"everPurchasedNametagColor",1) scoreboardRefresh(thePlayer) end function getNametagLevel(thePlayer) local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local playerLevel = tonumber(loadPlayerData(thePlayer,"level")) if playerLevel >= nametagLevel then if playerCash >= nametagPrice then callClientFunction(thePlayer,"showNametagWindow") else outputChatBox("#ff4000*#FFFFFFERROR! You don't have enough money!",thePlayer,255,255,255,true) end else outputChatBox("#ff4000*#FFFFFFERROR! You need to be level #ABCDEF"..nametagLevel.."#FFFFFF or higher to change your nametag color!",thePlayer,255,255,255,true) end end function setNametagColor(thePlayer) local ifSet = tonumber(getElementData(thePlayer,"everPurchasedNametagColor")) if ifSet == 1 then local useColor = loadPlayerData(thePlayer,"useCustomNametag") if useColor == "true" then local r = tonumber(loadPlayerData(thePlayer,"nametagRed")) local g = tonumber(loadPlayerData(thePlayer,"nametagGreen")) local b = tonumber(loadPlayerData(thePlayer,"nametagBlue")) callClientFunction(thePlayer,"setCustomNametagColor",true,r,g,b) end end end addEventHandler("onPlayerJoin",getRootElement(),setNametagColor)
  5. Ah already got an answer from another scripter who has the same userpanel. Problem is in loadplayerdata and saveplayerdata so how could i fix this problem so it would work without problems?
  6. I have thsi userpanel that doesnt have alot of debug errors but it lags so much that other peoples with better PC-s are crashing then this resource is working. How can i fix this and why is it so laggy?
  7. Sex*

    Debug

    PlEASE HELP!
  8. Sex*

    Debug

    My server is creating errors again. The errors are "attemt to compare two nil values". The errors are coming then two players are alive. Then only one player in the server, errors dont come. The function there its coming: function RaceMode:updateRanks() -- Make a table with the active players local sortinfo = {} for i,player in ipairs(getActivePlayers()) do sortinfo[i] = {} sortinfo[i].player = player sortinfo[i].checkpoint = getPlayerCurrentCheckpoint(player) sortinfo[i].cpdist = distanceFromPlayerToCheckpoint(player, sortinfo[i].checkpoint ) end -- Order by cp table.sort( sortinfo, function(a,b) return a.checkpoint > b.checkpoint or ( a.checkpoint == b.checkpoint and a.cpdist < b.cpdist ) end )
  9. Sex*

    Moving the text

    I got a awesome script. But... i need to change it to the right, i already tried something but nothing changed. I already looked at this: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize but no information that would be useful. Here is what it looks in original. dxDrawColorText("#ffffff".. messageJoin,30,y/2-20,574.0,20.0,tocolor(200,0,0,255),1,"default-bold","left","top",false,false,false) dxDrawImage (10,x/2-20,16,16,"icon/join.png",0,-120) Its in the left side now, but i want it to be in the right side.
  10. clientside yeah, problem is that it just doesnt work.
  11. Well, why not this doesnt work? function ResetModel ( ) engineRestoreModel ( 411 ) end addEvent ( "restoreClientModel", true ) addEventHandler ( "restoreClientModel", getRootElement(), ResetModel ) addEventHandler("onClientMapStarting",getRootElement(), ResetModel)
  12. Well, this doesnt work: function ResetModel ( ) engineRestoreModel ( 411 ) end addEvent ( "restoreClientModel", true ) addEventHandler ( "restoreClientModel", getRootElement(), ResetModel ) addEventHandler("onClientMapStarting",getRootElement(), ResetModel)
  13. Why not? FFS server and some other servers load my custom GTA infernus.dff and infernus.txd wheels on map starting.
  14. no....i want to load infernus.txd and infernus.dff from GTA directory.
  15. function ResetModel ( ) engineRestoreModel ( 411 ) end addEvent ( "restoreClientModel", true ) addEventHandler ( "restoreClientModel", getRootElement(), ResetModel ) addEventHandler("onClientMapStarting",getRootElement(), ResetModel)
  16. Why this dont work? I want MTA to load infernus.dff and infernus.txd from GTA directory. function mod() txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler("onClientMapStarting",getResourceRootElement(getThisResource()), mod) addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), mod)
  17. Sex*

    SetRankDisplay

    Will, How You Will Use "setRankDisplay" ? I dont...Some thing from race resource is calling it...
  18. Sex*

    SetRankDisplay

    Because i didnt want that function and i dont want it to come back.
  19. Sex*

    SetRankDisplay

    I get this error: [2013-02-09 17:54:24] ERROR: race\race_client.lua:626: attempt to call global 'setRankDisplay' (a nil value) The 626 Event: addEventHandler('onClientElementDataChange', g_Me, function(dataName) if dataName == 'race rank' and not Spectate.active then setRankDisplay( getElementData(g_Me, 'race rank') ) end end, false )
  20. Sex*

    Low Fps Plz help me

    Indeed, i have Intel HD(little better) and i only sometimes have 50+ fps.
  21. Sex*

    Destructionderby

    Thanks Cadu, works. Someone can delete this topic now:D
  22. Sex*

    How to color code?

    Now my MTA crashes then i start the resource...i can only turn off MTA with taskmanager...
  23. Sex*

    How to color code?

    Yes, it's clientside. But the function have some bugs with color codes. Yes, i know that the coloring function is in the clientside but i cant find a place where should i put it...
×
×
  • Create New...