Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. Oh nothing i fixed it sorry for that was a small bug.
  2. Got another problem when player die he spawn with 172 skin Idk how to fix that here is the code local mySkins = { 284, 40, 18, 172, } local index = { } function Selection ( player ) showCursor ( player, true ) bindKey ( player, "rshift", "down", Spawn ) bindKey ( player, "arrow_l", "down", SwitchSkin ) bindKey ( player, "arrow_r", "down", SwitchSkin ) fadeCamera ( player, true ) index [ player ] = 1 end function Selection2 ( player ) if ( not isPedDead ( player ) ) then outputChatBox ( " ", player, 0, 255, 0 ) outputChatBox ( "You'll choose your skin again.", player, 0, 138, 138 ) outputChatBox ( "Press Arrow keys to switch skins and Right shift to spawn!", player, 0, 138, 138 ) killPed ( player, player ) end setTimer ( Selection, 1000, 1, player ) end function SwitchSkin ( player, key ) if ( key == "arrow_l" ) then if ( index [ player ] == 1 ) then index [ player ] = #mySkins else index [ player ] = ( index [ player ] - 1 ) end else if ( index [ player ] == #mySkins ) then index [ player ] = 1 else index [ player ] = ( index [ player ] + 1 ) end end outputChatBox ( index [ player ] ) setElementModel ( player, mySkins [ index [ player ] ] ) playSoundFrontEnd ( player, 32 ) end function Spawn ( player ) showCursor ( player, false ) playSoundFrontEnd ( player, 44 ) outputChatBox("Done!", player, 0, 255, 138) unbindKey ( player, "rshift", "down", Spawn ) unbindKey ( player, "arrow_l", "down", SwitchSkin ) unbindKey ( player, "arrow_r", "down", SwitchSkin ) setCameraTarget ( player, player ) end function GamemodeStart ( res ) local players = getElementsByType ( "player" ) for _, v in ipairs ( players ) do bindKey ( v, "F4", "down", Selection2 ) outputChatBox ( "< Press Arrow keys to switch skins and Right shift to spawn. >", v, 255, 138, 0 ) setTimer ( SpawnPlayer, 1000, 1, v ) setTimer ( Selection, 1000, 1, v ) fadeCamera ( v, true ) end end function GamemodeEnd ( res ) local players = getElementsByType ( "player") for _, v in ipairs ( players ) do unbindKey ( v, "F4", "down", Selection2 ) end end function PlayerDeath ( ) setTimer ( SpawnPlayer, 1000, 1, source ) end function SpawnPlayer ( source ) spawnPlayer ( source, -1643.89941, 652.95648, -4.90625, 269.1424, 172 ) end function PlayerJoin ( ) bindKey ( source, "F4", "down", Selection2 ) outputChatBox ( "< Press Arrow Keys to switch skins and Right shift to spawn. >", source, 255, 255, 0 ) setTimer ( SpawnPlayer, 1000, 1, source ) fadeCamera (source, true ) setTimer ( Selection, 1500, 1, source ) end addEventHandler("onPlayerWasted", getRootElement(),PlayerDeath) addEventHandler ( "onResourceStart", resourceRoot, GamemodeStart ) addEventHandler ( "onResourceStop", resourceRoot, GamemodeEnd ) addEventHandler ( "onPlayerJoin", getRootElement(), PlayerJoin )
  3. Okay gonna try i didn't saw that. Working thanks
  4. @Blaawee i tried the last one but that let me chose betwen 171 and 133 @Solidsnake same bug I can selecto only 171 and 133
  5. Hello i found a skin selector script in community, and i want player select only betwen 4 skins 171, 172, 133, 149 Thanks for help. function Selection(player) showCursor(player, true) bindKey(player,"rshift","down",Spawn) bindKey(player,"arrow_l","down",SwitchSkin) bindKey(player,"arrow_r","down",SwitchSkin) fadeCamera ( player, true ) end function Selection2(player) if(not isPedDead(player) == true) then outputChatBox(" ", player, 0, 255, 0) outputChatBox("You'll choose your skin again.", player, 0, 138, 138) outputChatBox("Press Arrow keys to switch skins and Right shift to spawn!", player, 0, 138, 138) killPed(player, player) end setTimer(Selection,1000,2,player) end function SwitchSkin( player, key ) local skin skin = getElementModel(player) if(key == "arrow_l" and skin ~= 0) then setElementModel(player,skin - 1) else setElementModel(player,skin + 1) end playSoundFrontEnd (player, 32 ) end function Spawn( player ) showCursor(player, false) playSoundFrontEnd (player, 44) outputChatBox("Done!", player, 0, 255, 138) unbindKey ( player, "rshift", "down", Spawn ) unbindKey ( player, "arrow_l", "down", SwitchSkin ) unbindKey ( player, "arrow_r", "down", SwitchSkin ) setCameraMode ( player, "player" ) end function GamemodeStart( res ) players = getElementsByType ( "player") for k,v in ipairs(players) do bindKey(v,"F4","down",Selection2) outputChatBox("< Press Arrow keys to switch skins and Right shift to spawn. >", v, 255, 138, 0) setTimer(SpawnPlayer,1000,2,v) setTimer(Selection,1000,2,v) fadeCamera ( v, true ) end end function GamemodeEnd( res ) players = getElementsByType ( "player") for k,v in ipairs(players) do unbindKey(v,"F4","down",Selection2) end end function PlayerDeath() setTimer(SpawnPlayer,1000,2,source) end function SpawnPlayer(source) spawnPlayer(source, -2026.5035, 156.7506, 29.0391, 269.1424, 167) end function PlayerJoin() bindKey(source,"F4","down",Selection2) outputChatBox("< Press Arrow Keys to switch skins and Right shift to spawn. >", source, 255, 255, 0) setTimer(SpawnPlayer,1000,2,source) fadeCamera (source, true ) setTimer(Selection,1500,2,source) end addEventHandler("onResourceStart", getRootElement(),GamemodeStart) addEventHandler("onResourceStop", getRootElement(),GamemodeEnd) addEventHandler("onPlayerJoin", getRootElement(),PlayerJoin) I will run a Zombie server Resident evil mod and i want player choose btw Leon and Alice and Claire And Chris
  6. Didn't work, but when i tried addCommandHandler ( "setxp", function ( thePlayer, _, who, XP ) local XP = tonumber ( XP ) or 0 local ThePlayer = getPlayerFromName ( who ) if ( ThePlayer ) then setElementData( ThePlayer,"XP",XP ) end end ) Worked perfectly anyway thanks its fixed now
  7. Hello i have a little problem this dont set player xp addCommandHandler ( "setxp", function ( thePlayer, _, who, XP ) local XP = tonumber ( XP ) or 0 local ThePlayer = getPlayerFromName ( who ) if ( ThePlayer ) then setElementData( ThePlayer, XP ) end end ) thanks for help
  8. addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local S = getElementData(killer, "Level") if tonumber(S) == 0 then setElementData(source,"Emblems","ranks/lvl_0.png") elseif tonumber(S) == 1 then setElementData(source,"Emblems","ranks/lvl_1.png") elseif tonumber(S) == 2 then setElementData(source,"Emblems","ranks/lvl_2.png") elseif tonumber(S) == 3 then setElementData(source,"Emblems","ranks/lvl_3.png") elseif tonumber(S) == 4 then setElementData(source,"Emblems","ranks/lvl_4.png") elseif tonumber(S) == 5 then setElementData(source,"Emblems","ranks/lvl_5.png") elseif tonumber(S) == 6 then setElementData(source,"Emblems","ranks/lvl_6.png") elseif tonumber(S) == 7 then setElementData(source,"Emblems","ranks/lvl_7.png") elseif tonumber(S) == 8 then setElementData(source,"Emblems","ranks/lvl_8.png") elseif tonumber(S) == 9 then setElementData(source,"Emblems","ranks/lvl_9.png") elseif tonumber(S) == 10 then setElementData(source,"Emblems","ranks/lvl_10.png") elseif tonumber(S) == 11 then setElementData(source,"Emblems","ranks/lvl_11.png") elseif tonumber(S) == 12 then setElementData(source,"Emblems","ranks/lvl_12.png") elseif tonumber(S) == 13 then setElementData(source,"Emblems","ranks/lvl_13.png") elseif tonumber(S) == 14 then setElementData(source,"Emblems","ranks/lvl_14.png") elseif tonumber(S) == 15 then setElementData(source,"Emblems","ranks/lvl_15.png") elseif tonumber(S) == 16 then setElementData(source,"Emblems","ranks/lvl_16.png") elseif tonumber(S) == 17 then setElementData(source,"Emblems","ranks/lvl_17.png") elseif tonumber(S) == 18 then setElementData(source,"Emblems","ranks/lvl_18.png") elseif tonumber(S) == 19 then setElementData(source,"Emblems","ranks/lvl_19.png") elseif tonumber(S) == 20 then setElementData(source,"Emblems","ranks/lvl_20.png") elseif tonumber(S) == 21 then setElementData(source,"Emblems","ranks/lvl_21.png") elseif tonumber(S) == 22 then setElementData(source,"Emblems","ranks/lvl_22.png") elseif tonumber(S) == 23 then setElementData(source,"Emblems","ranks/lvl_23.png") end end ) addEventHandler("onPlayerSpawn",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local Emblems = getAccountData(account,"LV") if emblems then setElementData(source,"Emblems", emblems) end end )
  9. i found a script in community here is the client side local x, y = guiGetScreenSize() SkinMusic = "data/music/SkinSelectMusic.mp3" SkinAnims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"} StartSkin = 0 NewSkin = false function SelectSkin () setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) setCameraMatrix( 2745.8266601563,-2231.1694335938,62.25520324707, 3999.9999499991,-2607.4000244141,16.1) skin = createPed ( StartSkin, 2749.7502441406,-2232.7170410156,61.727611541748,60 ) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) fadeCamera( true, 10) setTime(0,0) SkinSelectMusic = playSound(SkinMusic,true) bindKey("arrow_r","down",NextSkin) bindKey("arrow_l","down",LastSkin) bindKey(".","down",SpawnPlayer) addEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(true) showChat(false) showPlayerHudComponent ( "radar", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() SelectSkin() FreezeBots() end) function SpawnPlayer() local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b ) unbindKey("arrow_r","down",NextSkin) unbindKey("arrow_l","down",LastSkin) unbindKey("lshift","down",SpawnPlayer) setTime(12,0) stopSound(SkinSelectMusic) removeEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(false) showChat(true) showPlayerHudComponent ( "radar", true ) guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) setElementData(getLocalPlayer(),"red",r) setElementData(getLocalPlayer(),"green",g) setElementData(getLocalPlayer(),"blue",b) end function NextSkin() if StartSkin == 312 then StartSkin = -1 elseif StartSkin == 2 then StartSkin = 8 end StartSkin = StartSkin + 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end function LastSkin() if StartSkin == 0 then StartSkin = 313 elseif StartSkin == 9 then StartSkin = 3 end StartSkin = StartSkin - 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end lnextskin = guiCreateButton(x-x/1.30,y/1.22,x/5,y/20,"<<<",false) guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") guiSetFont(lnextskin,"sa-header") rnextskin = guiCreateButton(x-x/2.90,y/1.22,x/5,y/20,">>>",false) guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") guiSetFont(rnextskin,"sa-header") spawnskin = guiCreateButton(x-x/1.80,y/1.22,x/5,y/20,"Play",false) guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") guiSetFont(spawnskin,"sa-header") addEventHandler( "onClientGUIClick", getRootElement(), function() if source == lnextskin then LastSkin() elseif source == rnextskin then NextSkin() elseif source == spawnskin then SpawnPlayer() end end) ------PEDS function FreezeBots() local Bots = getElementsByType("ped") for k,v in ipairs(Bots) do setElementFrozen(v,true) end end function loadMansion () outputChatBox("[bem-Vindo Ao Server]", getRootElement(), 255, 0, 0,true ) end addEventHandler("onClientResourceStart", getResourceRootElement(), loadMansion) server side StartMoney = 500 CashForKill = 150 PayNSprayCost = 100 playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49} function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 1539.7673339844,-1352.8256835938,329.46545410156, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function PlayerRespawn(diedPlayer) if not diedPlayer then else toggleAllControls(diedPlayer,true) setPlayerMoney(diedPlayer,StartMoney) spawnPlayer ( diedPlayer, 1539.7673339844,-1352.8256835938,329.46545410156, 90.0,playerSkin[diedPlayer][1]) setCameraTarget (diedPlayer, diedPlayer) end end function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end) Skins i want to player select is 172 171 173
  10. Hello Im looking for a skin selector i want it only for two skins i mean player can select only from two skins, Thanks for helping.
  11. exp system or the other one?
  12. Wont work nothing in debug .-.
  13. https://community.multitheftauto.com/index.php?p= ... ls&id=3016
  14. Client side: addEventHandler("onClientResourceStart", resourceRoot, function () setAircraftMaxVelocity(13.41) end ) addEventHandler("onClientResourceStop", resourceRoot, function () setAircraftMaxVelocity(1.5) end ) Server side: function handleResourceStart( ) setAircraftMaxVelocity( 13.5 ) end addEventHandler( "onResourceStart", resourceRoot, handleResourceStart )
  15. Client side: function showPlayerSquares() if getElementData(getLocalPlayer(), "state.hud") == "disabled" then return end local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if not vehicle then return end if getElementModel(vehicle) == 425 or getElementModel(vehicle) == 476 or getElementModel(vehicle) == 520 then players = getElementsByType("player") for _, thePlayer in ipairs(players)do if thePlayer ~= getLocalPlayer() then local x,y,z = getElementPosition(thePlayer) local cx,cy,cz = getElementPosition(getLocalPlayer()) if getDistanceBetweenPoints3D(x,y,z, cx,cy,cz) <= 1000 then sX, sY, sZ = getScreenFromWorldPosition(x,y,z) if(sX and sY and sZ)then color = tocolor(getPlayerNametagColor(thePlayer)) dxDrawLine(sX+20, sY+20, sX-20, sY+20,color, 2) dxDrawLine(sX+20, sY-20, sX-20, sY-20,color, 2) dxDrawLine(sX+20, sY-20, sX+20, sY+20,color, 2) dxDrawLine(sX-20, sY-20, sX-20, sY+20,color, 2) dxDrawText(getPlayerName(thePlayer), sX-20, sY+25, 25, 20, color, 0.9) dxDrawText(math.floor(getDistanceBetweenPoints3D(x,y,z, cx,cy,cz)).." m", sX-20, sY+40, 25, 20, color, 0.9) color = tocolor(255, 255, 255) x,y,z = getPedBonePosition ( thePlayer, -- s8) --> x,y = getScreenFromWorldPosition( x, y, z) x2,y2,z2 = getPedBonePosition ( thePlayer, 2) x2,y2 = getScreenFromWorldPosition(x2, y2, z2) if x and y and x2 and y2 then dxDrawLine(x,y,x2,y2, color, 1.5) end -----------------SHOULDERS----------------- Hx,Hy,Hz = getPedBonePosition ( thePlayer, 4) Hx,Hy = getScreenFromWorldPosition( Hx, Hy, Hz) Sx2,Sy2,Sz2 = getPedBonePosition ( thePlayer, 22) Sx2,Sy2 = getScreenFromWorldPosition(Sx2, Sy2, Sz2) Sx3,Sy3,Sz3 = getPedBonePosition ( thePlayer, 32) Sx3,Sy3 = getScreenFromWorldPosition(Sx3, Sy3, Sz3) if Hx and Hy and Sx2 and Sy2 then dxDrawLine(Hx,Hy,Sx2,Sy2, color, 1.5) end if Hx and Hy and Sx3 and Sy3 then dxDrawLine(Hx,Hy,Sx3,Sy3, color, 1.5) end -----------------UPPER ARMS----------------- ERx,ERy,ERz = getPedBonePosition ( thePlayer, 23) ERx,ERy = getScreenFromWorldPosition( ERx,ERy,ERz) ELx,ELy,ELz = getPedBonePosition ( thePlayer, 33) ELx,ELy = getScreenFromWorldPosition(ELx,ELy,ELz) if ERx and ERy and Sx2 and Sy2 then dxDrawLine(ERx,ERy,Sx2,Sy2, color, 1.5) end if ELx and ELy and Sx3 and Sy3 then dxDrawLine(ELx,ELy,Sx3,Sy3, color, 1.5) end -----------------LOWER ARMS----------------- HRx,HRy,HRz = getPedBonePosition ( thePlayer, 24) HRx,HRy = getScreenFromWorldPosition( HRx,HRy,HRz) HLx,HLy,HLz = getPedBonePosition ( thePlayer, 34) HLx,HLy = getScreenFromWorldPosition(HLx,HLy,HLz) if ERx and ERy and HRx and HRy then dxDrawLine(ERx,ERy,HRx,HRy, color, 1.5) end if ELx and ELy and HLx and HLy then dxDrawLine(ELx,ELy,HLx,HLy, color, 1.5) end -----------------UPPER LEGS----------------- KRx,KRy,KRz = getPedBonePosition ( thePlayer, 52) KRx,KRy = getScreenFromWorldPosition( KRx,KRy,KRz) KLx,KLy,KLz = getPedBonePosition ( thePlayer, 42) KLx,KLy = getScreenFromWorldPosition(KLx,KLy,KLz) if x2 and y2 and KRx and KRy then dxDrawLine(x2,y2,KRx,KRy, color, 1.5) end if x2 and y2 and KLx and KLy then dxDrawLine(x2,y2,KLx,KLy, color, 1.5) end -----------------LOWER LEGS----------------- LRx,LRy,LRz = getPedBonePosition ( thePlayer, 53) LRx,LRy = getScreenFromWorldPosition( LRx,LRy,LRz ) LLx,LLy,LLz = getPedBonePosition ( thePlayer, 43) LLx,LLy = getScreenFromWorldPosition(LLx,LLy,LLz) if LRx and LRy and KRx and KRy then dxDrawLine(LRx,LRy,KRx,KRy, color, 1.5) end if LLx and LLy and KLx and KLy then dxDrawLine(LLx,LLy,KLx,KLy, color, 1.5) end end end end end end end addEventHandler("onClientRender", getRootElement(), showPlayerSquares)
  16. Hello all i made this it show levels with images but i have a little problem i want add it to my dxhud using local Emblems = getAccountData(account,"LV") if emblems and fileExists ( ":experience/ranks/lvl_"..emblems..".png" ) then size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") dxDrawImage((557/1024)*sWidth, (745/768)*sHeight, size, size, ":experience/ranks/lvl_"..emblems..".png") end here is the script i guess there is some errors in it addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local S = getElementData(killer, "Level") if tonumber(S) == 0 then setElementData(source,"Emblems","ranks/lvl_0.png") elseif tonumber(S) == 1 then setElementData(source,"Emblems","ranks/lvl_1.png") elseif tonumber(S) == 2 then setElementData(source,"Emblems","ranks/lvl_2.png") elseif tonumber(S) == 3 then setElementData(source,"Emblems","ranks/lvl_3.png") elseif tonumber(S) == 4 then setElementData(source,"Emblems","ranks/lvl_4.png") elseif tonumber(S) == 5 then setElementData(source,"Emblems","ranks/lvl_5.png") elseif tonumber(S) == 6 then setElementData(source,"Emblems","ranks/lvl_6.png") elseif tonumber(S) == 7 then setElementData(source,"Emblems","ranks/lvl_7.png") elseif tonumber(S) == 8 then setElementData(source,"Emblems","ranks/lvl_8.png") elseif tonumber(S) == 9 then setElementData(source,"Emblems","ranks/lvl_9.png") elseif tonumber(S) == 10 then setElementData(source,"Emblems","ranks/lvl_10.png") elseif tonumber(S) == 11 then setElementData(source,"Emblems","ranks/lvl_11.png") elseif tonumber(S) == 12 then setElementData(source,"Emblems","ranks/lvl_12.png") elseif tonumber(S) == 13 then setElementData(source,"Emblems","ranks/lvl_13.png") elseif tonumber(S) == 14 then setElementData(source,"Emblems","ranks/lvl_14.png") elseif tonumber(S) == 15 then setElementData(source,"Emblems","ranks/lvl_15.png") elseif tonumber(S) == 16 then setElementData(source,"Emblems","ranks/lvl_16.png") elseif tonumber(S) == 17 then setElementData(source,"Emblems","ranks/lvl_17.png") elseif tonumber(S) == 18 then setElementData(source,"Emblems","ranks/lvl_18.png") elseif tonumber(S) == 19 then setElementData(source,"Emblems","ranks/lvl_19.png") elseif tonumber(S) == 20 then setElementData(source,"Emblems","ranks/lvl_20.png") elseif tonumber(S) == 21 then setElementData(source,"Emblems","ranks/lvl_21.png") elseif tonumber(S) == 22 then setElementData(source,"Emblems","ranks/lvl_22.png") elseif tonumber(S) == 23 then setElementData(source,"Emblems","ranks/lvl_23.png") end end ) addEventHandler("onPlayerSpawn",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local Emblems = getAccountData(account,"LV") if emblems then setElementData(source,"Emblems", emblems) end end ) And here is my Level system Elements local XP = getElementData(localPlayer,"XP") local Level = getElementData(localPlayer,"Level") Thanks for helping.
  17. Try this (tested) local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.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 ) end end )
  18. -.Paradox.-

    Rank

    Its ok now i fixed it, can you help me here? https://forum.multitheftauto.com/viewtopic.php?f ... 8&start=15
×
×
  • Create New...