-
Posts
1,239 -
Joined
-
Last visited
Everything posted by -.Paradox.-
-
Like that ? exports.scoreboard:scoreboardAddColumn("ExP") exports.scoreboard:scoreboardAddColumn("Level") local levels = {[50] = Rookie, [100] = Amateur, [175] = SemiPro, [240] = Pro, [950] = Elite, [1200] = Boss, [2000] = Hero, [5000] = Evil, [9963] = Demon, [20000] = Criminal} function win(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local H = getElementData(killer, "ExP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) setElementData(killer, "ExP", tonumber(H)+math.random ( 10, 80 ) ) if levels[tonumber(H)] then setElementData(killer, "Level", "Lvl ".. tostring(levels[tonumber(H)]) .." ") triggerClientEvent ( killer, "playSound", killer ) end end local H = getElementData ( source, "ExP" ) or 0 setElementData ( source, "ExP", tonumber ( H ) - math.random ( 5, 50 ) ) end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "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)
-
im not using level.xml im using this exports.scoreboard:scoreboardAddColumn("ExP") exports.scoreboard:scoreboardAddColumn("Level") local levels = {[50] = 1, [100] = 2, [175] = 3, [240] = 4, [950] = 5, [1200] = 6, [2000] = 7, [5000] = 8, [9963] = 9, [20000] = 10, [100000] = 11} function win(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local H = getElementData(killer, "ExP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) setElementData(killer, "ExP", tonumber(H)+math.random ( 10, 80 ) ) if levels[tonumber(H)] then setElementData(killer, "Level", "Lvl ".. tostring(levels[tonumber(H)]) .." ") triggerClientEvent ( killer, "playSound", killer ) end end local H = getElementData ( source, "ExP" ) or 0 setElementData ( source, "ExP", tonumber ( H ) - math.random ( 5, 50 ) ) end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "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) Do you want set the player level if write [[command]] ? or do you want set the level name ? Level change local levels to level name
-
and if i want change levels to like Example Level 1 : Rookie Level 2 : Amateur Level 3 : Semi-pro Level 4 : Pro Level 5 : ELITE Level 6 : Boss can you help me ?
-
Can somebody help me ?
-
and i will never success, just give me an example.
-
i dont know how to make it
-
can you make it to me please
-
ok what i need to do now ?
-
i have server side here is it function cmdInstallSound(player, cmd, file) if not file then outputChatBox("[uSAGE] /installsound [sound name]", player); end local xml, soundNode; xml = xmlLoadFile(":soundplayer/meta.xml"); soundNode = xmlCreateChild(xml, "file"); xmlNodeSetAttribute(soundNode, "src", "sounds/" .. file .. ".mp3"); xmlSaveFile(xml); xmlUnloadFile(xml); if restartResource(getThisResource()) then outputChatBox("The sound file is installed, use /playsound " .. file, player); else outputChatBox("Restart this resource please", player); end end addCommandHandler("installsound", cmdInstallSound); can you do it to me please
-
https://forum.multitheftauto.com/viewtop ... 1339a7be73
-
thanks but what about the music script
-
ok but there isnt a solution for set player exp ?
-
Oh ok, i will try it it set exp only for me not for other players
-
yes on meta function="getPlayerLevel" type="server" /> -- arguments: thePlayer --> function="setPlayerLevel" type="server" /> -- arguments: thePlayer, theLevel --> function="getPlayerEXP" type="server" /> -- arguments: thePlayer --> function="setPlayerEXP" type="server" /> -- arguments: thePlayer, theExperience --> function="addPlayerEXP" type="server" /> -- arguments: thePlayer, theExperience --> function="getAccountLevel" type="server" /> -- arguments: theAccount --> function="setAccountLevel" type="server" /> -- arguments: theAccount, theLevel --> function="getAccountEXP" type="server" /> -- arguments: theAccount --> function="setAccountEXP" type="server" /> -- arguments: theAccount, theExperience --> function="addAccountEXP" type="server" /> -- arguments: theAccount, theExperience --> function="getLevelData" type="server" /> -- arguments: theLevel -->
-
no errors function ( thePlayer, commandName, theLevel , playerName) what about this ?
-
Castillo, i tryed this but not working can you fix it please This for set player exp addCommandHandler ( "setexp", function ( thePlayer, commandName, theExP ) local theExP = tonumber ( theExP ) or 0 exports.exp_system:setPlayerExP ( thePlayer, theExP ) end ) and this for set player level addCommandHandler ( "setlevel", function ( thePlayer, commandName, theLevel ) local theLevel = tonumber ( theLevel ) or 1 exports.exp_system:setPlayerLevel ( thePlayer, theLEvel ) end )
-
no no not that, when a player start the music i want to show like example Steven:Is playing..file.. Anything else ?
-
Hello, i need help with this script i want add getPlayerName Function here is the lua function cmdPlaySound(cmd, file) if not file then return outputChatBox("[uSAGE] /startmusic [name]", getLocalPlayer()); end if playSound("sounds/" .. file .. ".mp3") then outputChatBox(Is Playing " .. file,255,255,255); end end addCommandHandler("startmusic", cmdPlaySound); i want when player start music it show on chatbox like example if playSound("sounds/" .. file .. ".mp3") then outputChatBox(..getPlayerName..#0096FFIs Playing " .. file,255,255,255); end