Jump to content

Einheit-101

Distinguished Members
  • Posts

    661
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Einheit-101

  1. is it possible to draw that image ONLY over the head of an admin player? addEventHandler("onClientRender",getRootElement(), function() local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix() for k, v in ipairs(getElementsByType("player")) do if(getElementData(v, "Admin") == true) then tx, ty, tz = getElementPosition(v) dist = math.sqrt((px - tx) ^ 2 + (py - ty) ^ 2 + (pz - tz) ^ 2) if dist < 30.0 then if isLineOfSightClear(px, py, pz, tx, ty, tz, true, false, false, true, false, false, getLocalPlayer()) then local sx, sy, sz = getPedBonePosition(v, 5) local x,y = getScreenFromWorldPosition(sx, sy, sz + 0.3) if x then dxDrawImage ( x, y, 140, 140, "rang/admin.png" ) end end end end end ) Thats what i have.
  2. Hello again... Little Question. How to draw a StaticImage above each player`s head (like his nametag)? I want to make this looking like the chaticon resource (but it is no chaticon ) I hope anybody knows how to reaslize that!
  3. HMM. That would be NOT good. But you are right. Maybe its possible to create the object for every player, but how to make that?
  4. Hello guys! I have a question (again) and now i want to know, how to make this script server-sided so the object "helm" can be seen by every player. At the moment this obect can only be seen by the client because the "helm" is created and moved in a client-sided script. I hope anybody is able to help! helm = nil helmart = nil zahl = 0 function stahlhelm() if (zahl ~= nil or zahl ~= 0) then rz = getPedRotation (getLocalPlayer()) px, py, pz = getPedBonePosition(getLocalPlayer(), 8) px = px+( ( math.cos ( math.rad ( rz ) ) ) * 0.02 ) - math.sin ( math.rad ( rz ) ) * 0.007 py = py+( ( math.sin ( math.rad ( rz ) ) ) * 0.02 ) + math.cos ( math.rad ( rz ) ) * 0.007 if (zahl == 1) then if (helmart == 1) or (helmart == 2) then setElementPosition (helm, px, py, pz+0.1 ) setElementRotation (helm, 0,0,(rz-180) ) else setElementPosition (helm, px, py, pz+0.112 ) setElementRotation (helm, 0,0,(rz-180) ) end end end end addEventHandler ( "onClientPreRender", getRootElement(), stahlhelm ) function helmi(player, helmart) helmart = tonumber(helmart) if (helmart == "" or helmart == nil) then outputChatBox ( "Valid numbers are 0,1,2 and 3." ) end if (helmart == 0) then destroyElement(helm) zahl = 0 end if (helmart == 1) then if (zahl == 0) then outputChatBox ( "Stahlhelm 1" ) helm = createObject (2052, px, py, pz+0.11, 0, 0, rz ) -- tommy setObjectScale(helm, 0.85) setElementDoubleSided ( helm, true ) zahl = 1 setElementData ( getLocalPlayer(), "helmeted", true ) end end if (helmart == 2) then if (zahl == 0) then outputChatBox ( "Stahlhelm 2" ) helm = createObject (2053, px, py, pz+0.11, 0, 0, rz ) -- jerry setObjectScale(helm, 0.85) setElementDoubleSided ( helm, true ) zahl = 1 setElementData ( getLocalPlayer(), "helmeted", true ) end end if (helmart == 3) then if (zahl == 0) then outputChatBox ( "Offiziersmütze" ) helm = createObject (2054, px, py, pz+0.11, 0, 0, rz ) -- officer setObjectScale(helm, 0.85) setElementDoubleSided ( helm, true ) zahl = 1 setElementData ( getLocalPlayer(), "helmeted", true ) end end if (helmart > 3) then outputChatBox ( "Valid numbers are 0,1,2 and 3." ) end end addCommandHandler("stahl", helmi) function res() outputChatBox("Stahlhelm by Einheit-101 loaded", 245,0,0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), res) I also want to say, that i DO NOT WANT that this script is published by anyone. Thanks a lot.
  5. Aha, nice, and this includes big Smoke clouds? Okay I will test it next week... Thanks for reply
  6. Hello Community! I have a little Question. I want to create a Vapor Cone (whats that? google! ) for my uberschall resource but i do not know how to create a big smoke cloud or something similar. It seems there is no function like fxCreateSmoke().
  7. nope! why that? I will upload a Video in which you can see this problem! Its on my Admin Aircraft Carrier and on the first Floor is a shop. But if i walk on the second floor over the x,y Position of the Marker (15 meters above!) the shop opens. I have Fixed this Problem with the following trick: I use for those Shops now "Arrow" markers. Those arrows trigger correctly and everything is fine!
  8. Hello People! I dont know if anyone knows this or if this is a script error of my shop resource: function bought3 ( button, state ) local money = getPlayerMoney(getLocalPlayer()) if (money > 999) then takePlayerMoney (1000) triggerServerEvent("predator2spawn", getRootElement()) outputChatBox("You have bought a Predator for 1000$.", getLocalPlayer()) else outputChatBox("You have not enough $ for a Predator. You need 1000$.", getLocalPlayer()) end end addEventHandler( "onClientGUIClick", buyButton4, bought3, false ) BUT if i go into the shop and buy my boat i lose 1000$ and 1 second later i have the 1000$ again!!! Its just like anything has given me 1000 dollar back. Maybe its a glitch of the function takePlayerMoney(). EDIT::: Maybe i will try Server sided takePlayerMoney later. EDIT #2::: I found another glitch. onMarkerHit and onClientMarkerHit does not work correctly. If i hit a marker 100 meters above this event triggers, but i did not hit the marker. This Event does not check the Z Position of Player and Marker i think
  9. Hmmm That is something i hear very often! I hate that!
  10. Thanks for the fast reply! I will test it right now... *EDIT* O M G I dont believe it! You made it! Love you man!
  11. Hello Comrades! I have a little problem! I wanted to make a script that opens a window which lets you choose 2 different spawn points: 1 angel Pine, the other Blueberry acres! But it outputs some error messages: Unexpected error: Spawn GUI has not been created. (My debug outputChatbox) broph.lua:33: Bad argument @ addEventHandler broph.lua:51: Bad argument @ addEventHandler broph.lua:60: Bad argument @ ShowCursor broph.lua:61: Bad argument @ attempt to call global setInputEnabled (a nil value) function createSpawnWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwSpawn = guiCreateWindow(X, Y, Width, Height, "Select a Spawn area", true) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnPine = guiCreateButton(X, Y, 0.3, 0.15, "Angel Pine", true, wdwSpawn) btnBerry = guiCreateButton(X, Y, 0.5, 0.15, "Blueberry", true, wdwSpawn) guiSetVisible(wdwSpawn, false) end addEventHandler ( "onClientResourceStart", getRootElement(), createSpawnWindow ) function angelpine(button, state) if button == "left" and state == "up" then spawnPlayer(client, -2138.8+math.random(1,5), -2352+math.random(4,7), 37.732, 90, math.random(281,286)) fadeCamera(client, true) setCameraTarget(player, client) giveWeapon(player, 25, 25) givePlayerMoney(player, 250) outputChatBox("Spawning in Angel Pine...") guiSetInputEnabled(false) guiSetVisible(wdwSpawn, false)--208.2, -240, 1.8 showCursor(false) end end addEventHandler("onClientGUIClick", btnPine, angelpine, false) function blueberry(button, state) if button == "left" and state == "up" then spawnPlayer(client, 208.2+math.random(1,3),-240+math.random(1,3), 1.8, 90, math.random(281,286)) fadeCamera(client, true) setCameraTarget(player, client) giveWeapon(player, 25, 25) givePlayerMoney(player, 250) outputChatBox("Spawning in Blueberry...") guiSetInputEnabled(false) guiSetVisible(wdwSpawn, false) showCursor(false) end end addEventHandler("onClientGUIClick", btnPine, blueberry, false) function window(ammo, attacker, weapon, bodypart) if (wdwSpawn ~= nil) then guiSetVisible(wdwSpawn, true) else outputChatBox("Unexpected error: Spawn GUI has not been created.") end showCursor(true) guiSetInputEnabled(true) end function start() setTimer(window, 9000, 1) end addEventHandler ( "onPlayerWasted", getRootElement(), start) function start() setTimer(window, 9000, 1) end addEventHandler ( "onClientResourceStart", getRootElement(), start ) function start() setTimer(window, 9000, 1) end addEventHandler ( "onPlayerJoin", getRootElement(), start )
  12. Hello People, As you can see I am back from the underground . Bad for you? But I have a problem with this script down there. The objective is to "attach" one of the objects (2052, 2053, 2054) to the HEAD of a player (2052,53 and 54 are helmets) but if i type for example "/stahl 2" nothing happens. Thats the way it should work: If u type "/stahl 1" element 2052 will be generated If u type "/stahl 2" element 2053 will be generated If u type "/stahl 3" element 2054 will be generated If u type "/stahl 0" all elements will be destroyed. I think the problems are the arguments, i`ve scripted not for a long time now... helm = nil helmart = nil zahl = nil function stahlhelm() if (zahl ~= nil or zahl ~= 0) then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) if (zahl == 1) then moveObject (helm, 10, px, py, pz+0.05, 0, 0, 0 ) setElementRotation ( helm, 0, 0, r ) end end end addEventHandler ( "onClientRender", getRootElement(), stahlhelm ) addCommandHandler("stahl", function (player, command, helmart) if helmart == or helmart == nil then outputChatBox ( "Valid numbers are 0,1,2 and 3." ) end if (helmart == 0) then destroyElement(helm) zahl = 0 end if (helmart == 1) then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) helm = createObject (2052, px, py, pz+0.05, 0, 0, r ) -- tommy zahl = 1 end if helmart == 2 then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) helm = createObject (2053, px, py, pz+0.05, 0, 0, r ) -- jerry zahl = 1 end if (helmart == 3) then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) helm = createObject (2054, px, py, pz+0.05, 0, 0, r ) -- officer zahl = 1 end if (helmart > 3) then outputChatBox ( "Valid numbers are 0,1,2 and 3." ) end end)
  13. Hmmm.... Under the bar showing your money should be a picture showing your rank. other players cant see this picture. its like a HUD element.
  14. only one player should see the picture. its a rank logo. I understand that like "i have to rename the functions because they have the same name as the images". I work on it...
  15. varez, youre my hero. EDIT::: WORKS NOW; CAN BE CLOSED.
  16. ye but its still not working lol
  17. Ohhh i hate those n00b errors... thanks. I look after it. EDIT::: It works now. But how can i make an "or" because the script doesnt trigger vehicle_secondary_fire. so: if (getControlState ( "vehicle_fire" )) OR (getControlState ( "vehicle_secondary_fire" )) then ... how to make an or?
  18. WHAT?!? I forgot the brackets? A n00b mistake³! And i dent know how to make it like you said with the arguments^^ I already said that its enough for me when it just works anyway; a small/efficient script is not sooo important.
  19. Hello again! I have made a script which should prevent the rhino from firing so fast (reload-script) but whats wrong? No error messages, nothing happens: CLIENT: fired = false function toggle1() local Player = getLocalPlayer() if fired == false then if isPedInVehicle ( Player ) then local theVehicle = getPedOccupiedVehicle ( Player ) if ( getElementModel ( theVehicle ) == 432 ) then if (getControlState ( vehicle_fire )) then setTimer (function() toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) end, 500, 1) fired = true setTimer (toggle2, 8000, 1) end end end end end addEventHandler ( "onClientRender", getRootElement(), toggle1 ) function toggle2() toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) fired = false end -no server.lua
  20. ***EDITET CODE*** Hey Guys, I made a final version of my rank script but it still doesnt work. The console/server does not output anything. INFOS: This script should promote you to a new rank if you have killed a amount of zombies, a gui element should show your rank. this "guiCreateStaticImage" should create a image and every rank has a different one. I use setAccountData because i want to save the rank. I also want a dxscoreboard tab showing the rank; it shows the tab rank, but nothing else. SERVER: function onResourceStart(startedResource) if startedResource == getThisResource() then call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Rank") end end addEventHandler("onResourceStart", getRootElement(), onResourceStart) pic = false addEvent( "onZombieWasted" ); addEventHandler( "onZombieWasted", getRootElement(), function( killer ) local player = getPlayerAccount ( killer ) local myRank = getAccountData(player,"rank") local zombieKills = getAccountData(player, "zombieKills") if (myRank == "" or myRank == nil or myRank == false) then if pic == false then myRank = "[1]PVT" triggerClientEvent("imagecall", getRootElement()) pic = true end end if (zombieKills == "" or zombieKills == nil or zombieKills == false) then zombieKills = 0 setAccountData (killer,"zombieKills",zombieKills+1); givePlayerMoney( killer, 25 ) --give money for killed Zombies if (getAccountData (player,"zombieKills") == 20) then setAccountData (player,"rank","[2]PFC") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Private First Class.") triggerClientEvent("r1", getRootElement()) elseif (getAccountData (player,"zombieKills") == 40) then setAccountData (player,"rank","[3]SPC") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Specialist.") triggerClientEvent("r2", getRootElement()) elseif (getAccountData (player,"zombieKills") == 100) then setAccountData (player,"rank","[4]CPL") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Corporal.") triggerClientEvent("r3", getRootElement()) elseif (getAccountData (player,"zombieKills") == 200) then setAccountData (player,"rank","[5]SGT") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Sergeant.") triggerClientEvent("r4", getRootElement()) elseif (getAccountData (player,"zombieKills") == 350) then setAccountData (player,"rank","[6]SSG") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Staff Sergeant.") triggerClientEvent("r5", getRootElement()) elseif (getAccountData (player,"zombieKills") == 600) then setAccountData (player,"rank","[7]SFC") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Sergeant First Class.") triggerClientEvent("r6", getRootElement()) elseif (getAccountData (player,"zombieKills") == 900) then setAccountData (player,"rank","[8]MSG") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Master Sergeant.") triggerClientEvent("r7", getRootElement()) elseif (getAccountData (player,"zombieKills") == 1500) then setAccountData (player,"rank","[9]1SG") outputChatBox (getPlayerName(killer)" has been promoted. He is now a First Sergeant.") triggerClientEvent("r8", getRootElement()) elseif (getAccountData (player,"zombieKills") == 1800) then setAccountData (player,"rank","[10]SGM") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Sergeant Major.") triggerClientEvent("r9", getRootElement()) elseif (getAccountData (player,"zombieKills") == 2300) then setAccountData (player,"rank","[11]CSM") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Command Sergeant Major.") triggerClientEvent("r10", getRootElement()) elseif (getAccountData (player,"zombieKills") == 3000) then setAccountData (player,"rank","[12]SMA") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Sergeant Major of the Army.") triggerClientEvent("r11", getRootElement()) elseif (getAccountData (player,"zombieKills") == 4000) then setAccountData (player,"rank","[13]2LT") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Second Lieutenant.") triggerClientEvent("r12", getRootElement()) elseif (getAccountData (player,"zombieKills") == 5500) then setAccountData (player,"rank","[14]1LT") outputChatBox (getPlayerName(killer)" has been promoted. He is now a First Lieutenant.") triggerClientEvent("r13", getRootElement()) elseif (getAccountData (player,"zombieKills") == 7000) then setAccountData (player,"rank","[15]CPT") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Captain.") triggerClientEvent("r14", getRootElement()) elseif (getAccountData (player,"zombieKills") == 9000) then setAccountData (player,"rank","[16]MAJ") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Major.") triggerClientEvent("r15", getRootElement()) elseif (getAccountData (player,"zombieKills") == 11500) then setAccountData (player,"rank","[17]LTC") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Lieutenant Colonel.") triggerClientEvent("r16", getRootElement()) elseif (getAccountData (player,"zombieKills") == 14000) then setAccountData (player,"rank","[18]COL") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Colonel.") triggerClientEvent("r17", getRootElement()) elseif (getAccountData (player,"zombieKills") == 17000) then setAccountData (player,"rank","[19]BG") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Brigadier General.") triggerClientEvent("r18", getRootElement()) elseif (getAccountData (player,"zombieKills") == 21000) then setAccountData (player,"rank","[20]MG") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Major General.") triggerClientEvent("r19", getRootElement()) elseif (getAccountData (player,"zombieKills") == 26000) then setAccountData (player,"rank","[21]LTG") outputChatBox (getPlayerName(killer)" has been promoted. He is now a Lieutenant General.") triggerClientEvent("r20", getRootElement()) elseif (getAccountData (player,"zombieKills") == 35000) then setAccountData (player,"rank","[22]GEN") outputChatBox (getPlayerName(killer)" has been promoted. He is now a General.") triggerClientEvent("r21", getRootElement()) elseif (getAccountData (player,"zombieKills") == 50000) then setAccountData (player,"rank","[23]GA") outputChatBox (getPlayerName(killer)" has reached the highest rank! He is General of the Army!") triggerClientEvent("r22", getRootElement()) end end end ) CLIENT: local xp,yp = guiGetScreenSize() x = xp/2 - 60/2+ 500 y = yp/2 - 60/2 + yp/4.5 function image() image1 = guiCreateStaticImage( x, y, 50, 48, "rang/r1.png", false ) end addEvent("imagecall", true) addEventHandler("imagecall", getRootElement(), image) function guiElement() if look == nil then look = 0 display = textCreateDisplay() textDisplayAddObserver (display,killer) rank = textCreateTextItem ("Rank: "..myRank,0.8,0.53,"medium",255,50,0,150,1.5) textDisplayAddText (display,rank) elseif look == 0 then textItemSetText (rank,"Rank: "..myRank) textItemSetText (rank,"Rank: "..myRank) end addEventHandler("onClientResourceStart", getRootElement(), guiElement) addEvent("r1", true) function image2() destroyElement(image1) image2 = guiCreateStaticImage( x,y,50,60, "rang/r2.png", false ) end addEvent("r2", true) function image3() destroyElement(image3) image3 = guiCreateStaticImage( x,y,50,55, "rang/r3.png", false ) end addEvent("r3", true) function image4() destroyElement(image4) image4 = guiCreateStaticImage( x,y,50,55, "rang/r4.png", false ) end addEvent("r4", true) function image5() destroyElement(image5) image5 = guiCreateStaticImage( x,y,50,63, "rang/r5.png", false ) end addEvent("r5", true) function image6() destroyElement(image6) image6 = guiCreateStaticImage( x,y,50,75, "rang/r6.png", false ) end addEvent("r6", true) function image7() destroyElement(image7) image7 = guiCreateStaticImage( x,y,50,83, "rang/r7.png", false ) end addEvent("r7", true) function image8() destroyElement(image8) image8 =guiCreateStaticImage( x,y,50,90, "rang/r8.png", false ) end addEvent("r8", true) function image9() destroyElement(image9) image9 = guiCreateStaticImage( x,y,50,90, "rang/r9.png", false ) end addEvent("r9", true) function image10() destroyElement(image10) image10 = guiCreateStaticImage( x,y,50,90, "rang/r10.png", false ) end addEvent("r10", true) function image11() destroyElement(image11) image12 = guiCreateStaticImage( x,y,50,90, "rang/r11.png", false ) end addEvent("r11", true) function image12() destroyElement(image12) image13 = guiCreateStaticImage( x,y,50,90, "rang/r12.png", false ) end addEvent("r12", true) function image13() destroyElement(image13) image14 = guiCreateStaticImage( x,y,24,60, "rang/r13.png", false ) end addEvent("r13", true) function image14() destroyElement(image14) image15 = guiCreateStaticImage( x,y,24,60, "rang/r14.png", false ) end addEvent("r14", true) function image15() destroyElement(image15) image16 = guiCreateStaticImage( x,y,60,58, "rang/r15.png", false ) end addEvent("r15", true) function image16() destroyElement(image16) image17 = guiCreateStaticImage( x,y,60,60, "rang/r16.png", false ) end addEvent("r16", true) function image17() destroyElement(image17) image18 = guiCreateStaticImage( x,y,60,60, "rang/r17.png", false ) end addEvent("r17", true) function image18() destroyElement(image18) image19 = guiCreateStaticImage( x,y,108,61, "rang/r18.png", false ) end addEvent("r18", true) function image19() destroyElement(image19) image20 = guiCreateStaticImage( x,y,67,64, "rang/r19.png", false ) end addEvent("r19", true) function image20() destroyElement(image20) image21 = guiCreateStaticImage( x,y,112,57, "rang/r20.png", false ) end addEvent("r20", true) function image21() destroyElement(image21) image22 = guiCreateStaticImage( x,y,112,41, "rang/r21.png", false ) end addEvent("r21", true) function image22() destroyElement(image22) image23 = guiCreateStaticImage( x,y,143,39, "rang/r22.png", false ) end addEvent("r22", true) function image23() destroyElement(image23) image24 = guiCreateStaticImage( x,y,112,104, "rang/r23.png", false ) end addEventHandler( "r1", getRootElement(), image2 ) addEventHandler( "r2", getRootElement(), image3 ) addEventHandler( "r3", getRootElement(), image4 ) addEventHandler( "r4", getRootElement(), image5 ) addEventHandler( "r5", getRootElement(), image6 ) addEventHandler( "r6", getRootElement(), image7 ) addEventHandler( "r7", getRootElement(), image8 ) addEventHandler( "r8", getRootElement(), image9 ) addEventHandler( "r9", getRootElement(), image10 ) addEventHandler( "r10", getRootElement(), image11 ) addEventHandler( "r11", getRootElement(), image12 ) addEventHandler( "r12", getRootElement(), image13 ) addEventHandler( "r13", getRootElement(), image14 ) addEventHandler( "r14", getRootElement(), image15 ) addEventHandler( "r15", getRootElement(), image16 ) addEventHandler( "r16", getRootElement(), image17 ) addEventHandler( "r17", getRootElement(), image18 ) addEventHandler( "r18", getRootElement(), image19 ) addEventHandler( "r19", getRootElement(), image20 ) addEventHandler( "r20", getRootElement(), image21 ) addEventHandler( "r21", getRootElement(), image22 ) addEventHandler( "r22", getRootElement(), image23 ) I HAVE ADDED ALL THE CODE.
  21. :::HERE IS THE CODE::: It happens Nothing. No error messages. server: function onResourceStart(startedResource) if startedResource == getThisResource() then call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Rank") end end addEventHandler("onResourceStart", getRootElement(), onResourceStart) function killed( ammo, attacker, weapon, bodypart ) if (attacker) then if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then if (getElementData (source, "zombie") == true) then local oldRank = getAccountData ( attacker, "myRank" ) setElementData ( attacker, "Rank", myRank ) end end end end addEventHandler("onPedWasted", resourceRoot, killed) Client: addEvent( "onZombieWasted" ); addEventHandler( "onZombieWasted", getRootElement(), function( killer ) local player = getPlayerAccount ( killer ) local myRank = getAccountData(player,"rank") local zombieKills = getAccountData(player, "zombieKills") if (myRank == "" or myRank == nil or myRank == false) then myRank = "[1]PVT" img = guiCreateStaticImage( 1100, 200, 60, 70, "rang/r1.png", false ) end if (zombieKills == "" or zombieKills == nil or zombieKills == false) then zombieKills = 0 givePlayerMoney( killer, 25 ) setAccountData (player,"zombieKills",zombieKills+1); end if look == nil then look = 0 display = textCreateDisplay() textDisplayAddObserver (display,killer) rank = textCreateTextItem ("Rank: "..myRank,0.8,0.53,"medium",255,50,0,150,1.5) textDisplayAddText (display,rank) elseif look == 0 then textItemSetText (rank,"Rank: "..myRank) textItemSetText (rank,"Rank: "..myRank) end local x,y = guiGetScreenSize() xpos = x/2 - 60/2+ 480 ypos = y/2 - 60/2 + y/4.5 if (getAccountData (player,"zombieKills") == 20) then setAccountData (player,"rank","[2]PFC") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Private First Class.") guiStaticImageLoadImage (img, "rang/r2.png" ) elseif (getAccountData (player,"zombieKills") == 40) then setAccountData (player,"rank","[3]SPC") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Specialist.") guiStaticImageLoadImage (img, "rang/r3.png" ) elseif (getAccountData (player,"zombieKills") == 100) then setAccountData (player,"rank","[4]CPL") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Corporal.") guiStaticImageLoadImage (img, "rang/r4.png" ) elseif (getAccountData (player,"zombieKills") == 200) then setAccountData (player,"rank","[5]SGT") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Sergeant.") guiStaticImageLoadImage (img, "rang/r5.png" ) elseif (getAccountData (player,"zombieKills") == 350) then setAccountData (player,"rank","[6]SSG") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Staff Sergeant.") guiStaticImageLoadImage (img, "rang/r6.png" ) elseif (getAccountData (player,"zombieKills") == 600) then setAccountData (player,"rank","[7]SFC") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Sergeant First Class.") guiStaticImageLoadImage (img, "rang/r7.png" ) elseif (getAccountData (player,"zombieKills") == 900) then setAccountData (player,"rank","[8]MSG") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Master Sergeant.") guiStaticImageLoadImage (img, "rang/r8.png" ) elseif (getAccountData (player,"zombieKills") == 1500) then setAccountData (player,"rank","[9]1SG") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a First Sergeant.") guiStaticImageLoadImage (img, "rang/r9.png" ) elseif (getAccountData (player,"zombieKills") == 2000) then setAccountData (player,"rank","[10]SGM") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Sergeant Major.") guiStaticImageLoadImage (img, "rang/r10.png" ) elseif (getAccountData (player,"zombieKills") == 3000) then setAccountData (player,"rank","[11]CSM") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Command Sergeant Major.") guiStaticImageLoadImage (img, "rang/r11.png" ) elseif (getAccountData (player,"zombieKills") == 4000) then setAccountData (player,"rank","[12]SMA") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Sergeant Major of the Army.") guiStaticImageLoadImage (img, "rang/r12.png" ) elseif (getAccountData (player,"zombieKills") == 5500) then setAccountData (player,"rank","[13]2LT") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Second Lieutenant.") guiStaticImageLoadImage (img, "rang/r13.png" ) elseif (getAccountData (player,"zombieKills") == 7000) then setAccountData (player,"rank","[14]1LT") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a First Lieutenant.") guiStaticImageLoadImage (img, "rang/r14.png" ) elseif (getAccountData (player,"zombieKills") == 9000) then setAccountData (player,"rank","[15]CPT") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Captain.") guiStaticImageLoadImage (img, "rang/r15.png" ) elseif (getAccountData (player,"zombieKills") == 11500) then setAccountData (player,"rank","[16]MAJ") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Major.") guiStaticImageLoadImage (img, "rang/r16.png" ) elseif (getAccountData (player,"zombieKills") == 14000) then setAccountData (player,"rank","[17]LTC") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Lieutenant Colonel.") guiStaticImageLoadImage (img, "rang/r17.png" ) elseif (getAccountData (player,"zombieKills") == 17000) then setAccountData (player,"rank","[18]COL") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Colonel.") guiStaticImageLoadImage (img, "rang/r18.png" ) elseif (getAccountData (player,"zombieKills") == 21000) then setAccountData (player,"rank","[19]BG") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Brigadier General.") guiStaticImageLoadImage (img, "rang/r19.png" ) elseif (getAccountData (player,"zombieKills") == 26000) then setAccountData (player,"rank","[20]MG") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Major General.") guiStaticImageLoadImage (img, "rang/r20.png" ) elseif (getAccountData (player,"zombieKills") == 33000) then setAccountData (player,"rank","[21]LTG") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a Lieutenant General.") guiStaticImageLoadImage (img, "rang/r21.png" ) elseif (getAccountData (player,"zombieKills") == 40000) then setAccountData (player,"rank","[22]GEN") outputChatBox (..getPlayerName(killer).." has been promoted. He is now a General.") guiStaticImageLoadImage (img, "rang/r22.png" ) elseif (getAccountData (player,"zombieKills") == 50000) then setAccountData (player,"rank","[23]GA") outputChatBox (..getPlayerName(killer).." has reached the highest rank! He is General of the Army!") guiStaticImageLoadImage (img, "rang/r23.png" ) end end ) end )
  22. Thanx varez! It works! I will upload this resource to community.multitheftauto.com with credits to you! I improved the sound. ******TOPIC CAN GET CLOSED******
  23. I am working on it. I dont want that you make it. I will post the code later and you can try to watch for errors.
×
×
  • Create New...