-
Posts
1,239 -
Joined
-
Last visited
Everything posted by -.Paradox.-
-
Turf system mmm i don't know i'll look for it.
-
http://www.mediafire.com/download/plu341gztgx91zw/the_gun_stats.rar
-
i can fix it to you tomorrow its too late here its 01:00 midnight Good night ill check tomorrow
-
it save evrything if i created a table it should crash and working fine on my server
-
Try this it should work perfectly addEventHandler ("onPlayerLogin",root, function() loadPedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerQuit",root, function() savePedStats( getPlayerAccount(source)) end ) addEventHandler ("onPlayerLogout",root, function(thePreviousAccount) savePedStats( thePreviousAccount ) end ) function savePedStats( Acc) local pedposx,pedposy,pedposz = getElementPosition( source ) local pedrotx,pedroty,pedrotz = getElementRotation( source ) setAccountData(Acc, "pos.x", pedposx) setAccountData(Acc, "pos.y", pedposy) setAccountData(Acc, "pos.z", pedposz) setAccountData(Acc, "rot.x", pedrotx) setAccountData(Acc, "rot.y", pedroty) setAccountData(Acc, "rot.z", pedrotz) setAccountData(Acc, "skin", getPedSkin( source )) setAccountData(Acc, "armor", getPedArmor( source )) setAccountData(Acc, "health", getElementHealth( source )) setAccountData(Acc, "money",getPlayerMoney( source )) for i = 21 , 25 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end for i = 69 , 79 do setAccountData(Acc, "stat."..i , getPedStat(source,i)) end end function loadPedStats(Acc ) setElementPosition(source,getAccountData(Acc, "pos.x"),getAccountData(Acc, "pos.y"),getAccountData(Acc, "pos.z")) setElementRotation(source,getAccountData(Acc, "rot.x"),getAccountData(Acc, "rot.y"),getAccountData(Acc, "rot.z")) setPedSkin(source,getAccountData(Acc, "skin")) setPedArmor(source,getAccountData(Acc, "armor")) setElementHealth(source,getAccountData(Acc, "health")) setPlayerMoney(source,getAccountData(Acc, "money")) for i = 21 , 25 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end for i = 69 , 79 do setPedStat(source,i,getAccountData(Acc, "stat."..i)) end end
-
you want to save stats ?
-
first go to mtaserver.conf Ctrl + F >> defaultstats >> u will find that line "defaultstats" startup="1" protected="0" /> Delete it and save download this and extract at resource folder start it all done
-
local stats = { [ 69 ] = 0, [ 70 ] = 0, [ 71 ] = 0, [ 72 ] = 0, [ 73 ] = 0, [ 74 ] = 0, [ 75 ] = 0, [ 76 ] = 0, [ 77 ] = 0, [ 78 ] = 0, [ 79 ] = 0, [ 160 ] = 0, [ 229 ] = 0, [ 230 ] = 0 } local function applyStats(player) for stat,value in pairs(stats) do setPedStat(player, stat, value) end end addEventHandler('onResourceStart', resourceRoot, function() for i,player in ipairs(getElementsByType('player')) do applyStats(player) end end ) addEventHandler('onPlayerJoin', root, function() applyStats(source) end ) addEventHandler('onGamemodeMapStart', root, function() for _,player in ipairs(getElementsByType('player')) do applyStats(player) end end ) addEventHandler('onPlayerSpawn', root, function() applyStats(source) end )
-
ill make it for you
-
do u want save stat system ? or just set default stats to 0 ?
-
Aaa i guess you need those files =========================================================================================================== Alcatraz map : https://community.multitheftauto.com/index.php?p=resources&s=details&id=7312 =========================================================================================================== Car System : https://community.multitheftauto.com/index.php?p=resources&s=details&id=2604 =========================================================================================================== Gang System : https://community.multitheftauto.com/index.php?p=resources&s=details&id=1514 =========================================================================================================== Turf System : https://community.multitheftauto.com/index.php?p=resources&s=details&id=5606 =========================================================================================================== Ammunation Shop : https://community.multitheftauto.com/index.php?p=resources&s=details&id=4857 Powerful Weapons Shop : https://community.multitheftauto.com/index.php?p=resources&s=details&id=5347 =========================================================================================================== There isnt a level system for turfing etc i have one only for DM here is the lua server side : server.lua 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) client side : command_c.lua if u write /getrep player name you ll get how much he got in exp and level function getRep ( _, playerName ) if ( playerName ) then local thePlayer = getPlayerFromName ( playerName ) if ( thePlayer ) then local ExP = getElementData ( thePlayer, "ExP" ) or 0 local Level = getElementData(thePlayer,"Level") or 0 outputChatBox ( getPlayerName ( thePlayer ) .." Reputation is ".. tostring ( ExP ) .." ".. tostring ( Level ) .." " ,47,47,47) else outputChatBox ( "Couldn't find '" .. playerName .. "'", source ) end end end addCommandHandler ( "getrep", getRep ) finally meta.xml All done have fun !
-
Castillo can u help me ?
-
Hello, I want a little help, If a player get in team his nametagcolor and blipcolor change to team color like Example : If player was in Forever Team he's namecolor and blip should be red please help i tryed this nut this set red color to all players -- needs configurable blip colors, and team support root = getRootElement () color = { 0, 255, 0 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) function onResourceStart ( resource ) for id, player in ipairs( getElementsByType ( "player" ) ) do local r, g, b = getTeamColor ( getPlayerTeam ( player ) ) createBlipAttachedTo ( player, 0, 2, r, g, b ) end end function onPlayerSpawn ( spawnpoint ) local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) createBlipAttachedTo ( source, 0, 2, r, g, b ) end function onPlayerQuit () destroyBlipsAttachedTo ( source ) end function onPlayerWasted ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end function setBlipsColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then for id, player in ipairs( getElementsByType ( "player" ) ) do destroyBlipsAttachedTo ( player ) createBlipAttachedTo ( player, 0, 2, r, g, b ) end end end function setBlipColor ( source, commandName, r, g, b ) if ( tonumber ( b ) ) then destroyBlipsAttachedTo ( source ) createBlipAttachedTo ( source, 0, 2, r, g, b ) end end addCommandHandler ( "setblipscolor", setBlipsColor ) addCommandHandler ( "setblipcolor", setBlipColor ) addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) function destroyBlipsAttachedTo(player) local attached = getAttachedElements ( player ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end
-
no another one 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)
-
Castillo, can you explain me please?
-
yes, that what i do, there isn't a solution? anything else ?
-
i don't understand sorry.
-
Yes addCommandHandler ( "setexp", function ( thePlayer, _, who, theExP ) local theExP = tonumber ( theExP ) or 0 local playerWho = getPlayerFromName ( who ) if ( playerWho ) then exports.exp_system:setPlayerEXP ( playerWho, theExP ) end end )
-
it was working fine now it show a error in console ERROR: attempt to call a nil value [string"?"] ERROR: call:failed to call 'exp_system:setPlayerEXP' [string"?"] help
-
i used it but i dont know how it works(how much player earn if he killed someone or how much he lost if he get killed)
-
Is there a solution that if i removed the local levels local levels = {[1] = 1, [50] = 2, [75] = 3, [240] = 4, [950] = 5, [1200] = 6, [2000] = 7, [5000] = 8, [9963] = 9, [20000] = 10, [100000] = 11} it load levels from levels.xml ? "Rookie" experienceRequired = "2" /> "Amateur" experienceRequired = "100" /> "Semi-Pro" experienceRequired = "150" /> "Pro" experienceRequired = "200" /> "ELITE" experienceRequired = "2000" />
-
the error is in createObject(3115, -1456.8000488281, 501.39999389648, 9.8999996185303, 0, 0, 0) as you can see 3115 is the id of gate, and here he's using 8000, -1456.8000488281, 501.39999389648, 9.8999996185303 he used id of gate 8000 he need to put 3115 like that 3115, -1456.8000488281, 501.39999389648, 9.8999996185303