Guest User

Untitled

a guest
Jul 22nd, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 35.81 KB | None | 0 0
  1. Medic Cars
  2. -- createFactionVehicle ( model, x, y, z, rx, ry, rz, 11, 0, 0, 0, 0 )
  3.  
  4. createFactionVehicle ( 416, -2588.7998046875, 622, 14.5, 0, 0, 270, 11, 1, 3, 0, 0 )
  5. createFactionVehicle ( 416, -2588.599609375, 627.19921875, 14.5, 0, 0, 270, 11, , 0, 0, 0 )
  6. createFactionVehicle ( 416, -2589, 632.599609375, 14.5, 0, 0, 270, 11, 1, 3, 0, 0 )
  7. createFactionVehicle ( 416, -2589.099609375, 637.599609375, 14.5, 0, 0, 270, 11, 0, , 0, 0 )
  8. createFactionVehicle ( 416, -2588.69921875, 647.3994140625, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  9. createFactionVehicle ( 416, -2588.3994140625, 653.099609375, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  10. createFactionVehicle ( 416, -2588.5, 658.099609375, 14.5, 0, 0, 270, 11, 1, 3, 0, 0 )
  11.  
  12.  
  13.  
  14. createFactionVehicle ( 597, -2571.5, 658, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  15. createFactionVehicle ( 597, -2570.69921875, 652.69921875, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  16. createFactionVehicle ( 597, -2571.599609375, 647.69921875, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  17. createFactionVehicle ( 597, -2571.2998046875, 638.2998046875, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  18. createFactionVehicle ( 597, -2571.3994140625, 632.19921875, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  19. createFactionVehicle ( 597, -2571.3994140625, 627.19921875, 14.5, 0, 0, 270, 11, 0, 0, 0, 0 )
  20.  
  21.  
  22. createFactionVehicle ( 563, -2644.7998046875, 668, 69.5, 0, 0, 90, 11, 1, 3, 0, 0 )
  23. createFactionVehicle ( 563, -2713.19921875, 669.7998046875, 68.5, 0, 0, 90, 11, 1, 3, 0, 0 )
  24.  
  25. Allround.
  26. fraktionMembers = {}
  27.  
  28. for i = 0, 99 do
  29.     fraktionMembers[i] = {}
  30. end
  31.  
  32. factionVehicles = {}
  33. factionVehicles[1] = {}
  34. factionVehicles[2] = {}
  35. factionVehicles[3] = {}
  36. factionVehicles[4] = {}
  37. factionVehicles[5] = {}
  38. factionVehicles[6] = {}
  39. factionVehicles[7] = {}
  40. factionVehicles[8] = {}
  41. factionVehicles[9] = {}
  42. factionVehicles[10] = {}
  43. factionVehicles[11] = {}
  44.  
  45. factionSkins = {}
  46. factionSkins[1] = { [1]=280, [2]=281, [3]=282, [4]=283, [5]=284, [6]=285, [7]=288, [8]=265, [9]=266, [10]=267 }
  47. factionSkins[2] = { [1]=111, [2]=112, [3]=113, [4]=124, [5]=125, [6]=126, [7]=127, [8]=237, [9]=211, [10]=272, [11]=290, }
  48. factionSkins[3] = { [1]=49, [2]=117, [3]=118, [4]=120, [5]=122, [6]=123, [7]=141, [8]=169, [9]=186, [10]=294 }
  49. factionSkins[4] = { [1]=221, [2]=222, [3]=220, [4]=143, [5]=142, [6]=307 }
  50. factionSkins[5] = { [1]=59, [2]=141, [3]=187, [4]=188, [5]=189, [6]=296 }
  51. factionSkins[6] = { [1]=285, [2]=286, [3]=165, [4]=164, [5]=163, [6]=295 }
  52. factionSkins[7] = { [1]=173, [2]=174, [3]=175, [4]=115, [5]=114, [6]=116, [7]=293 }
  53. factionSkins[8] = { [1]=287, [2]=312, [3]=191 }
  54. factionSkins[9] = { [1]=100, [2]=247, [3]=248, [4]=298 }
  55. factionSkins[10] = { [1]=106, [2]=105, [3]=269, [4]=271, [5]=270, [6]=107, [7]=0 }
  56. factionSkins[11] = { [1]=274, [2]=275, [3]=276, [4]=70 }
  57.  
  58.  
  59. fraktionNames = {}
  60. fraktionNames = { [1]="SFPD", [2]="Mafia", [3]="Triaden", [4]="Terroristen", [5]="Reporter", [6]="FBI", [7]="Aztecas", [8]="Army", [9]="Angels of Death", [10]="Grove", [11]="Medic" }
  61.  
  62. ---------------------------------------------------------------------------------------------------------------
  63.  
  64. function isPDCar ( car )
  65.     if factionVehicles[1][car] then return true else return false end
  66. end
  67.  
  68. function isMafiaCar ( car )
  69.     if factionVehicles[2][car] then return true else return false end
  70. end
  71.  
  72. function isTriadenCar ( car )
  73.     if factionVehicles[3][car] then return true else return false end
  74. end
  75.  
  76. function isTerrorCar ( car )
  77.     if factionVehicles[4][car] then return true else return false end
  78. end
  79.  
  80. function isNewsCar ( car )
  81.     if factionVehicles[5][car] then return true else return false end
  82. end
  83.  
  84. function isFBICar ( car )
  85.     if factionVehicles[6][car] then return true else return false end
  86. end
  87.  
  88. function isAztecasCar ( car )
  89.     if factionVehicles[7][car] then return true else return false end
  90. end
  91.  
  92. function isArmyCar ( car )
  93.     if factionVehicles[8][car] then return true else return false end
  94. end
  95.  
  96. function isBikerCar ( car )
  97.     if factionVehicles[9][car] then return true else return false end
  98. end
  99.  
  100. function isGroveCar ( car )
  101.     if factionVehicles[10][car] then return true else return false end
  102. end
  103.  
  104. function isMedicCar ( car )
  105.     if factionVehicles[11][car] then return true else return false end
  106. end
  107.  
  108. function isFederalCar ( car )
  109.     if isArmyCar( car ) or isFBICar( car ) or isPDCar ( car ) then
  110.         return true
  111.     else
  112.         return false
  113.     end
  114. end
  115.  
  116. function isEvilCar ( car )
  117.     if isMafiaCar( car ) or isTriadenCar( car ) or isTerrorCar ( car ) or isAztecasCar ( car ) or isBikerCar ( car ) or isGroveCar then
  118.         return true
  119.     else
  120.         return false
  121.     end
  122. end
  123.  
  124. function getPlayerFaction ( player )
  125.  
  126.     local fac = vioGetElementData ( player, "fraktion" )
  127.    
  128.     if fac then
  129.    
  130.         return tonumber(fac)
  131.    
  132.     else
  133.  
  134.         return false
  135.    
  136.     end
  137.  
  138. end
  139.  
  140. function getPlayerRank ( player )
  141.  
  142.     local ran = vioGetElementData ( player, "rang" )
  143.    
  144.     if ran then
  145.    
  146.         return tonumber(ran)
  147.    
  148.     else
  149.    
  150.         return false
  151.    
  152.     end
  153.  
  154. end
  155.  
  156. function getPlayerRankName ( player )
  157.  
  158.     local ran = getPlayerRank ( player )
  159.     local fac = getPlayerFaction ( player )
  160.    
  161.     if ran then
  162.    
  163.         return factionRankNames[fac][ran]
  164.    
  165.     else
  166.    
  167.         return false
  168.    
  169.     end
  170.  
  171. end
  172.  
  173. -----------------------------------------------------------------------------------------------------
  174.  
  175. function isReporter(player)
  176.     if tonumber(vioGetElementData ( player, "fraktion" )) == 5 then return true else return false end
  177. end
  178.  
  179. function isTerror(player)
  180.     if tonumber(vioGetElementData ( player, "fraktion" )) == 4 then return true else return false end
  181. end
  182.  
  183. function isTriad(player)
  184.     if tonumber(vioGetElementData ( player, "fraktion" )) == 3 then return true else return false end
  185. end
  186.  
  187. function isMafia(player)
  188.     if tonumber(vioGetElementData ( player, "fraktion" )) == 2 then return true else return false end
  189. end
  190.  
  191. function isCop(player)
  192.     if tonumber(vioGetElementData ( player, "fraktion" )) == 1 then return true else return false end
  193. end
  194.  
  195. function isFBI(player)
  196.     if tonumber(vioGetElementData ( player, "fraktion" )) == 6 then return true else return false end
  197. end
  198.  
  199. function isAztecas(player)
  200.     if tonumber(vioGetElementData ( player, "fraktion" )) == 7 then return true else return false end
  201. end
  202.  
  203. function isArmy(player)
  204.     if tonumber(vioGetElementData ( player, "fraktion" )) == 8 then return true else return false end
  205. end
  206.  
  207. function isBiker(player)
  208.     if tonumber(vioGetElementData ( player, "fraktion" )) == 9 then return true else return false end
  209. end
  210.  
  211. function isGrove(player)
  212.     if tonumber(vioGetElementData ( player, "fraktion" )) == 10 then return true else return false end
  213. end
  214.  
  215. function isMedic(player)
  216.     if tonumber(vioGetElementData ( player, "fraktion" )) == 11 then return true else return false end
  217. end
  218.  
  219.  
  220. ------------------------------------------------------------------------------------------------------
  221.  
  222. function isStateFaction(player)
  223.     if isArmy(player) or isCop(player) or isFBI(player) then return true else return false end
  224. end
  225.  
  226. function isOnStateDuty(player)
  227.     return isOnDuty(player)
  228. end
  229.  
  230. function isOnDuty(player)
  231.  
  232.     local model = getElementModel(player)
  233.    
  234.     for i, skin in pairs ( factionSkins[1] ) do
  235.    
  236.         if skin == model then
  237.        
  238.             return true
  239.        
  240.         end
  241.    
  242.     end
  243.    
  244.     for i, skin in pairs ( factionSkins[6] ) do
  245.    
  246.         if skin == model then
  247.        
  248.             return true
  249.        
  250.         end
  251.    
  252.     end
  253.    
  254.     for i, skin in pairs ( factionSkins[8] ) do
  255.    
  256.         if skin == model then
  257.        
  258.             return true
  259.        
  260.         end
  261.    
  262.     end
  263.    
  264.     return false
  265.    
  266. end
  267.  
  268. function isAbleOffduty ( player )
  269.  
  270.     local model = getElementModel(player)
  271.    
  272.     for i, skin in pairs ( factionSkins[1] ) do
  273.    
  274.         if skin == model then
  275.        
  276.             return true
  277.        
  278.         end
  279.    
  280.     end
  281.    
  282.     for i, skin in pairs ( factionSkins[6] ) do
  283.    
  284.         if skin == model then
  285.        
  286.             return true
  287.        
  288.         end
  289.    
  290.     end
  291.    
  292.     return false
  293.  
  294. end
  295.  
  296. function isEvil(player)
  297.     if isMafia(player) or isTriad(player) or isTerror(player) or isAztecas(player) or isBiker(player) or isGrove(player) then return true else return false end
  298. end
  299.  
  300. function isInDepotFaction(player)
  301.     if isMafia(player) or isTriad(player) or isTerror(player) or isReporter(player) or isAztecas(player) or isBiker(player) or isGrove(player) then return true else return false end
  302. end
  303.  
  304. ---------------------------------------------------------------------------------------------------
  305.  
  306. function sendMSGForFaction ( msg, faction, r, g, b )
  307.  
  308.     if not r then
  309.         local r, g, b = 200, 200, 100
  310.     end
  311.    
  312.     for playeritem, key in pairs ( fraktionMembers[faction] ) do
  313.         outputChatBox ( msg, playeritem, r, g, b )
  314.     end
  315.    
  316. end
  317.  
  318. function getFactionMembersOnline ( faction )
  319.  
  320.     if faction then
  321.         counter = 0
  322.         for playeritem, index in pairs ( fraktionMembers[faction] ) do
  323.             counter = counter + 1
  324.         end
  325.         return counter
  326.     else
  327.         return false
  328.     end
  329.    
  330. end
  331. function policeComputer ( presser, key, state )
  332.  
  333.     if state == "down" and isOnDuty(presser) and isFederalCar ( getPedOccupiedVehicle ( presser ) ) and getElementModel ( getPedOccupiedVehicle ( presser ) ) ~= 520 then
  334.         triggerClientEvent ( presser,"showPDComputer", getRootElement() )
  335.     end
  336.    
  337. end
  338. function createTeleportMarker ( x1, y1, z1, int1, dim1, x2, y2, z2, int2, dim2, rot, needetFaction )
  339.  
  340.     if not needetFaction then
  341.         needetFaction = 0
  342.     end
  343.    
  344.     local marker1 = createMarker ( x1, y1, z1 + 0.5, "corona", 1, 0, 0, 0, 0 )
  345.     local marker2 = createMarker ( x1, y1, z1, "cylinder", 1, 255, 0, 0, 150 )
  346.     setElementDimension ( marker1, dim1 )
  347.     setElementDimension ( marker2, dim1 )
  348.     setElementInterior ( marker1, int1 )
  349.     setElementInterior ( marker2, int1 )
  350.    
  351.     addEventHandler ( "onMarkerHit", marker1,
  352.         function ( hit, dim )
  353.             if dim then
  354.                 if getElementType ( hit ) == "player" then
  355.                     if not getPedOccupiedVehicle ( hit ) then
  356.                         if needetFaction == 0 or getElementData ( hit, "fraktion" ) == needetFaction then
  357.                             fadeElementInterior ( hit, int2, x2, y2, z2, rot, dim2 )
  358.                         else
  359.                             infobox ( hit, "Du bist nicht\nbefugt!", 5000, 125, 0, 0 )
  360.                         end
  361.                     end
  362.                 end
  363.             end
  364.         end
  365.     )
  366.    
  367. end
  368.  
  369. function createFactionVehicle ( model, x, y, z, rx, ry, rz, faction, c1, c2, c3, c4, numberplate )
  370.  
  371.     if not c3 then
  372.         c3 = 0
  373.     end
  374.    
  375.     if not c4 then
  376.         c4 = 0
  377.     end
  378.    
  379.     if not numberplate then
  380.         numberplate = fraktionNames[faction]
  381.     end
  382.    
  383.     local veh = createVehicle ( model, x, y, z, rx, ry, rz, numberplate )
  384.    
  385.     setVehicleColor ( veh, c1, c2, c3, c4 )
  386.     setVehiclePaintjob ( veh, 3 )
  387.     toggleVehicleRespawn ( veh, true )
  388.     setVehicleRespawnDelay ( veh, FCarDestroyRespawn * 1000 * 60 )
  389.     setVehicleIdleRespawnDelay ( veh, FCarIdleRespawn * 1000 * 60 )
  390.     --factionVehicles[faction][veh] = true
  391.    
  392.     vioSetElementData ( veh, "owner", fraktionNames[faction] )
  393.     vioSetElementData ( veh, "ownerfraktion", faction )
  394.    
  395.     if faction == 1 then
  396.    
  397.         addEventHandler ( "onVehicleEnter", veh,
  398.             function ( player, seat )
  399.                 local veh = source
  400.                 if getPedOccupiedVehicleSeat ( player ) == 0 then
  401.                     if not isOnDuty( player ) then
  402.                         opticExitVehicle ( player )
  403.                         infobox ( player, "Du bist kein\n"..fraktionNames[faction].."!", 5000, 125, 0, 0 )
  404.                     else
  405.                         if not isKeyBound ( player, "sub_mission", "down", policeComputer ) then
  406.                             bindKey ( player, "sub_mission", "down", policeComputer )
  407.                         end
  408.                     end
  409.                 else
  410.                
  411.                     if not isKeyBound ( player, "sub_mission", "down", policeComputer ) and isOnDuty( player ) then
  412.                         bindKey ( player, "sub_mission", "down", policeComputer )
  413.                     end
  414.                
  415.                 end
  416.             end )
  417.            
  418.     elseif faction == 6 then
  419.    
  420.         addEventHandler ( "onVehicleEnter", veh,
  421.             function ( player, seat )
  422.                 local veh = source
  423.                 if getPedOccupiedVehicleSeat ( player ) == 0 then
  424.                
  425.                     if isFBI ( player ) and isOnDuty( player ) then
  426.                         if not isKeyBound ( player, "sub_mission", "down", policeComputer ) then
  427.                             bindKey ( player, "sub_mission", "down", policeComputer )
  428.                         end
  429.                     else
  430.                         opticExitVehicle ( player )
  431.                         infobox ( player, "Du bist kein\n"..fraktionNames[faction].."!", 5000, 125, 0, 0 )
  432.                     end
  433.  
  434.                 else
  435.                
  436.                     if not isKeyBound ( player, "sub_mission", "down", policeComputer ) and isOnDuty( player ) then
  437.                         bindKey ( player, "sub_mission", "down", policeComputer )
  438.                     end
  439.                
  440.                 end
  441.             end )
  442.            
  443.     elseif faction == 8 then
  444.        
  445.         addEventHandler ( "onVehicleEnter", veh,
  446.             function ( player, seat )
  447.                 local veh = source
  448.                 if getPedOccupiedVehicleSeat ( player ) == 0 then
  449.                
  450.                     if not isArmy(player) then
  451.                         opticExitVehicle ( player )
  452.                         infobox ( player, "Du bist kein\n"..fraktionNames[faction].."!", 5000, 125, 0, 0 )
  453.                     else
  454.                    
  455.                         if not isKeyBound ( player, "sub_mission", "down", policeComputer ) and getElementModel ( veh ) ~= 520 then
  456.                             bindKey ( player, "sub_mission", "down", policeComputer )
  457.                         end
  458.                    
  459.                         if getElementModel ( veh ) == 433 then
  460.                        
  461.                             setElementHealth ( player, 100 )
  462.                             triggerClientEvent ( player, "sec_health_give", getRootElement(), 999 )
  463.                             setPedArmor ( player, 100 )
  464.                             triggerClientEvent ( player, "sec_armor_give", getRootElement(), 100 )
  465.                             triggerClientEvent ( player, "eatSomething", getRootElement() )
  466.                            
  467.                         elseif getElementModel ( veh ) == 432 then
  468.                        
  469.                             if vioGetElementData ( player, "job" ) ~= "tankcommander" then
  470.                                 opticExitVehicle ( player )
  471.                                 outputChatBox ( "Du hast nicht die erforderliche Klasse!", player, 125, 0, 0 )
  472.                             end
  473.                            
  474.                         elseif getElementModel ( veh ) == 425 or getElementModel ( veh ) == 520 then
  475.                        
  476.                             if vioGetElementData ( player, "job" ) ~= "air" then
  477.                                 opticExitVehicle ( player )
  478.                                 outputChatBox ( "Du hast nicht die erforderliche Klasse!", player, 125, 0, 0 )
  479.                             end
  480.                            
  481.                         elseif getElementModel ( veh ) == 563 or getElementModel ( veh ) == 595 then
  482.                            
  483.                             if vioGetElementData ( player, "job" ) ~= "marine" and seat == 0 then
  484.                                 opticExitVehicle ( player )
  485.                                 outputChatBox ( "Du hast nicht die erforderliche Klasse!", player, 125, 0, 0 )
  486.                             else
  487.                                 giveWeapon ( player, 46, 3, true )
  488.                                 triggerClientEvent ( player, "sec_gun_give", getRootElement(), 46, 3 )
  489.                             end
  490.                            
  491.                         end
  492.                    
  493.                     end
  494.                    
  495.                 else
  496.  
  497.                     if not isKeyBound ( player, "sub_mission", "down", policeComputer ) and isOnDuty( player ) then
  498.                         bindKey ( player, "sub_mission", "down", policeComputer )
  499.                     end
  500.                    
  501.                     if getElementModel ( veh ) == 433 then
  502.                    
  503.                         setElementHealth ( player, 100 )
  504.                         triggerClientEvent ( player, "sec_health_give", getRootElement(), 999 )
  505.                         setPedArmor ( player, 100 )
  506.                         triggerClientEvent ( player, "sec_armor_give", getRootElement(), 100 )
  507.                         triggerClientEvent ( player, "eatSomething", getRootElement() )
  508.                    
  509.                     end
  510.                    
  511.                 end
  512.             end )
  513.    
  514.     else
  515.    
  516.         addEventHandler ( "onVehicleEnter", veh,
  517.             function ( player, seat )
  518.                 local veh = source
  519.                 if getPedOccupiedVehicleSeat ( player ) == 0 then
  520.                     if vioGetElementData ( player, "fraktion" ) ~= faction then
  521.                         opticExitVehicle ( player )
  522.                         infobox ( player, "Du bist kein\n"..fraktionNames[faction].."!", 5000, 125, 0, 0 )
  523.                     end
  524.                 end
  525.             end )
  526.        
  527.     end
  528.        
  529.     return veh
  530.    
  531. end
  532.  
  533. function block_tie_cmds ( cmd )
  534.     cancelEvent()
  535. end
  536.  
  537. function tie_func ( player, cmd, target )
  538.  
  539.     local target = findPlayerByName( target )
  540.    
  541.     if target and target ~= player and getPedOccupiedVehicle ( target ) then
  542.    
  543.         if isEvil(player) or isOnDuty(player) then
  544.        
  545.             if getVehicleOccupant( getPedOccupiedVehicle ( player ) ) ~= target and getPedOccupiedVehicleSeat ( target ) > 0 then
  546.            
  547.                 local x1, y1, z1 = getElementPosition ( player )
  548.                 local x2, y2, z2 = getElementPosition ( target )
  549.                
  550.                 if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) <= 5 then
  551.                
  552.                     local boolean = not vioGetElementData ( target, "tied" )
  553.                     vioSetElementData ( target, "tied", boolean )
  554.                     toggleAllControls ( target, boolean )
  555.                     if boolean then fix = "ent" else fix = "ge" end
  556.                    
  557.                     if fix == "ge" then
  558.                    
  559.                         addEventHandler( "onPlayerCommand", target, block_tie_cmds )
  560.                            
  561.                     elseif fix == "ent" then
  562.                    
  563.                         removeEventHandler ( "onPlayerCommand", target, block_tie_cmds )
  564.                    
  565.                     end
  566.                    
  567.                     if fix == "ent" then
  568.                    
  569.                         fadeCamera ( target, true, 0.5, 0, 0, 0 )
  570.                        
  571.                     elseif isEvil ( player ) then
  572.                    
  573.                         fadeCamera ( target, false, 0.5, 0, 0, 0 )
  574.                        
  575.                     end
  576.                    
  577.                     outputChatBox ( "Du hast "..getPlayerName(target).." "..fix.."fesselt!", player, 0, 125, 0 )
  578.                     outputChatBox ( "Du wurdest von "..getPlayerName(player).." "..fix.."fesselt!", target, 200, 200, 0 )
  579.                    
  580.                 else
  581.                
  582.                     outputChatBox ( "Du bist zu weit weg!", player, 125, 0, 0 )
  583.                    
  584.                 end
  585.                
  586.             else
  587.            
  588.                 outputChatBox ( "Ungueltiges Ziel!", player, 125, 0, 0 )
  589.                
  590.             end
  591.            
  592.         else
  593.        
  594.             outputChatBox ( "Du bist in einer ungueltigen Fraktion!", player, 125, 0, 0 )
  595.            
  596.         end
  597.        
  598.     else
  599.    
  600.         outputChatBox ( "Ungueltiges Ziel!", player, 125, 0, 0 )
  601.        
  602.     end
  603.    
  604. end
  605.  
  606. addCommandHandler ( "tie", tie_func )
  607.  
  608. function fstate_func(player)
  609.  
  610.     if isMafia ( player ) then
  611.         outputChatBox ( "Bestand:", player, 0, 0, 125 )
  612.         outputChatBox ( "Schlagringe: "..MafiaSchlagringe.." von "..baseballcap, player, 0, 125, 0 )
  613.         outputChatBox ( "Baseballschlaeger: "..MafiaBaseballschlaeger.." von "..baseballcap, player, 0, 125, 0 )
  614.         outputChatBox ( "Messer: "..MafiaMesser.." von "..knifecap, player, 0, 125, 0 )
  615.         outputChatBox ( "Schaufeln: "..MafiaSchaufeln.." von "..shovelscap, player, 0, 125, 0 )
  616.         outputChatBox ( "Pistolen: "..MafiaPistolen.." von "..pistolcap, player, 0, 125, 0 )
  617.         outputChatBox ( "SD-Pistolen: "..MafiaSDPistolen.." von "..sdpistolcap, player, 0, 125, 0 )
  618.         outputChatBox ( "9mm Magazine: "..MafiaPistolenMagazine.." von "..pistolammocap, player, 0, 125, 0 )
  619.         outputChatBox ( "Desert Eagles: "..MafiaDesertEagles.." von "..eaglecap, player, 0, 125, 0 )
  620.         outputChatBox ( "Desert Eagle Magazine: "..MafiaDesertEagleMunition.." von "..eagleammocap, player, 0, 125, 0 )
  621.         outputChatBox ( "Schrotflinten: "..MafiaSchrotflinten.." von "..shotguncap, player, 0, 125, 0 )
  622.         outputChatBox ( "Schrotkugeln: "..MafiaSchrotflintenMunition.." von "..shotgunammocap, player, 0, 125, 0 )
  623.         outputChatBox ( "MP5: "..MafiaMP.." von "..mpcap, player, 0, 125, 0 )
  624.         outputChatBox ( "MP5 Magazine: "..MafiaMPMunition.." von "..mpammocap, player, 0, 125, 0 )
  625.         outputChatBox ( "AK-47: "..MafiaAK.." von "..akcap, player, 0, 125, 0 )
  626.         outputChatBox ( "Ak-47 Magazine "..MafiaAKMunition.." von "..akammocap, player, 0, 125, 0 )
  627.         outputChatBox ( "M4: "..MafiaM.." von "..mcap, player, 0, 125, 0 )
  628.         outputChatBox ( "M4 Magazine "..MafiaMMunition.." von "..mammocap, player, 0, 125, 0 )
  629.         outputChatBox ( "Gewehre: "..MafiaGewehre.." von "..gewehrcap, player, 0, 125, 0 )
  630.         outputChatBox ( "Gewehr Patronen: "..MafiaGewehrPatronen.." von "..gewehrammocap, player, 0, 125, 0 )
  631.         outputChatBox ( "Scharfschuetzengewehre: "..MafiaSGewehr.." von "..sgewehrcap, player, 0, 125, 0 )
  632.         outputChatBox ( "Scharfschuetzengewehr Patronen: "..MafiaSGewehrMunition.." von "..sgewehrammocap, player, 0, 125, 0 )
  633.         outputChatBox ( "Raketenwerfer: "..MafiaRaketenwerfer.." von "..raketenwerfercap, player, 0, 125, 0 )
  634.         outputChatBox ( "Raketen: "..MafiaRaketen.." von "..raketencap, player, 0, 125, 0 )
  635.         outputChatBox ( "Luparas: "..MafiaSpezwaffen.." von "..spezguncap, player, 0, 125, 0 )
  636.     elseif isTriad ( player ) then
  637.         outputChatBox ( "Bestand:", player, 0, 0, 125 )
  638.         outputChatBox ( "Schlagringe: "..TriadenSchlagringe.." von "..baseballcap, player, 0, 125, 0 )
  639.         outputChatBox ( "Baseballschlaeger: "..TriadenBaseballschlaeger.." von "..baseballcap, player, 0, 125, 0 )
  640.         outputChatBox ( "Messer: "..TriadenMesser.." von "..knifecap, player, 0, 125, 0 )
  641.         outputChatBox ( "Schaufeln: "..TriadenSchaufeln.." von "..shovelscap, player, 0, 125, 0 )
  642.         outputChatBox ( "Pistolen: "..TriadenPistolen.." von "..pistolcap, player, 0, 125, 0 )
  643.         outputChatBox ( "SD-Pistolen: "..TriadenSDPistolen.." von "..sdpistolcap, player, 0, 125, 0 )
  644.         outputChatBox ( "9mm Magazine: "..TriadenPistolenMagazine.." von "..pistolammocap, player, 0, 125, 0 )
  645.         outputChatBox ( "Desert Eagles: "..TriadenDesertEagles.." von "..eaglecap, player, 0, 125, 0 )
  646.         outputChatBox ( "Desert Eagle Magazine: "..TriadenDesertEagleMunition.." von "..eagleammocap, player, 0, 125, 0 )
  647.         outputChatBox ( "Schrotflinten: "..TriadenSchrotflinten.." von "..shotguncap, player, 0, 125, 0 )
  648.         outputChatBox ( "Schrotkugeln: "..TriadenSchrotflintenMunition.." von "..shotgunammocap, player, 0, 125, 0 )
  649.         outputChatBox ( "MP5: "..TriadenMP.." von "..mpcap, player, 0, 125, 0 )
  650.         outputChatBox ( "MP5 Magazine: "..TriadenMPMunition.." von "..mpammocap, player, 0, 125, 0 )
  651.         outputChatBox ( "AK-47: "..TriadenAK.." von "..akcap, player, 0, 125, 0 )
  652.         outputChatBox ( "Ak-47 Magazine "..TriadenAKMunition.." von "..akammocap, player, 0, 125, 0 )
  653.         outputChatBox ( "M4: "..TriadenM.." von "..mcap, player, 0, 125, 0 )
  654.         outputChatBox ( "M4 Magazine "..TriadenMMunition.." von "..mammocap, player, 0, 125, 0 )
  655.         outputChatBox ( "Gewehre: "..TriadenGewehre.." von "..gewehrcap, player, 0, 125, 0 )
  656.         outputChatBox ( "Gewehr Patronen: "..TriadenGewehrPatronen.." von "..gewehrammocap, player, 0, 125, 0 )
  657.         outputChatBox ( "Scharfschuetzengewehre: "..TriadenSGewehr.." von "..sgewehrcap, player, 0, 125, 0 )
  658.         outputChatBox ( "Scharfschuetzengewehr Patronen: "..TriadenSGewehrMunition.." von "..sgewehrammocap, player, 0, 125, 0 )
  659.         outputChatBox ( "Raketenwerfer: "..TriadenRaketenwerfer.." von "..raketenwerfercap, player, 0, 125, 0 )
  660.         outputChatBox ( "Raketen: "..TriadenRaketen.." von "..raketencap, player, 0, 125, 0 )
  661.         outputChatBox ( "Katanas: "..TriadenSpezwaffen.." von "..spezguncap, player, 0, 125, 0 )
  662.     elseif isAztecas ( player ) then
  663.         outputChatBox ( "Bestand:", player, 0, 0, 125 )
  664.         outputChatBox ( "Schlagringe: "..AztecasSchlagringe.." von "..baseballcap, player, 0, 125, 0 )
  665.         outputChatBox ( "Baseballschlaeger: "..AztecasBaseballschlaeger.." von "..baseballcap, player, 0, 125, 0 )
  666.         outputChatBox ( "Messer: "..AztecasMesser.." von "..knifecap, player, 0, 125, 0 )
  667.         outputChatBox ( "Schaufeln: "..AztecasSchaufeln.." von "..shovelscap, player, 0, 125, 0 )
  668.         outputChatBox ( "Pistolen: "..AztecasPistolen.." von "..pistolcap, player, 0, 125, 0 )
  669.         outputChatBox ( "SD-Pistolen: "..AztecasSDPistolen.." von "..sdpistolcap, player, 0, 125, 0 )
  670.         outputChatBox ( "9mm Magazine: "..AztecasPistolenMagazine.." von "..pistolammocap, player, 0, 125, 0 )
  671.         outputChatBox ( "Desert Eagles: "..AztecasDesertEagles.." von "..eaglecap, player, 0, 125, 0 )
  672.         outputChatBox ( "Desert Eagle Magazine: "..AztecasDesertEagleMunition.." von "..eagleammocap, player, 0, 125, 0 )
  673.         outputChatBox ( "Schrotflinten: "..AztecasSchrotflinten.." von "..shotguncap, player, 0, 125, 0 )
  674.         outputChatBox ( "Schrotkugeln: "..AztecasSchrotflintenMunition.." von "..shotgunammocap, player, 0, 125, 0 )
  675.         outputChatBox ( "MP5: "..AztecasMP.." von "..mpcap, player, 0, 125, 0 )
  676.         outputChatBox ( "MP5 Magazine: "..AztecasMPMunition.." von "..mpammocap, player, 0, 125, 0 )
  677.         outputChatBox ( "AK-47: "..AztecasAK.." von "..akcap, player, 0, 125, 0 )
  678.         outputChatBox ( "Ak-47 Magazine "..AztecasAKMunition.." von "..akammocap, player, 0, 125, 0 )
  679.         outputChatBox ( "M4: "..AztecasM.." von "..mcap, player, 0, 125, 0 )
  680.         outputChatBox ( "M4 Magazine "..AztecasMMunition.." von "..mammocap, player, 0, 125, 0 )
  681.         outputChatBox ( "Gewehre: "..AztecasGewehre.." von "..gewehrcap, player, 0, 125, 0 )
  682.         outputChatBox ( "Gewehr Patronen: "..AztecasGewehrPatronen.." von "..gewehrammocap, player, 0, 125, 0 )
  683.         outputChatBox ( "Scharfschuetzengewehre: "..AztecasSGewehr.." von "..sgewehrcap, player, 0, 125, 0 )
  684.         outputChatBox ( "Scharfschuetzengewehr Patronen: "..AztecasSGewehrMunition.." von "..sgewehrammocap, player, 0, 125, 0 )
  685.         outputChatBox ( "Raketenwerfer: "..AztecasRaketenwerfer.." von "..raketenwerfercap, player, 0, 125, 0 )
  686.         outputChatBox ( "Raketen: "..AztecasRaketen.." von "..raketencap, player, 0, 125, 0 )
  687.         outputChatBox ( "Molotovs: "..AztecasSpezwaffen.." von "..spezguncap, player, 0, 125, 0 )
  688.     elseif isBiker(player) then
  689.         outputChatBox ( "Bestand:", player, 0, 0, 125 )
  690.         outputChatBox ( "Schlagringe: "..BikerSchlagringe.." von "..baseballcap, player, 0, 125, 0 )
  691.         outputChatBox ( "Baseballschlaeger: "..BikerBaseballschlaeger.." von "..baseballcap, player, 0, 125, 0 )
  692.         outputChatBox ( "Messer: "..BikerMesser.." von "..knifecap, player, 0, 125, 0 )
  693.         outputChatBox ( "Schaufeln: "..BikerSchaufeln.." von "..shovelscap, player, 0, 125, 0 )
  694.         outputChatBox ( "Pistolen: "..BikerPistolen.." von "..pistolcap, player, 0, 125, 0 )
  695.         outputChatBox ( "SD-Pistolen: "..BikerSDPistolen.." von "..sdpistolcap, player, 0, 125, 0 )
  696.         outputChatBox ( "9mm Magazine: "..BikerPistolenMagazine.." von "..pistolammocap, player, 0, 125, 0 )
  697.         outputChatBox ( "Desert Eagles: "..BikerDesertEagles.." von "..eaglecap, player, 0, 125, 0 )
  698.         outputChatBox ( "Desert Eagle Magazine: "..BikerDesertEagleMunition.." von "..eagleammocap, player, 0, 125, 0 )
  699.         outputChatBox ( "Schrotflinten: "..BikerSchrotflinten.." von "..shotguncap, player, 0, 125, 0 )
  700.         outputChatBox ( "Schrotkugeln: "..BikerSchrotflintenMunition.." von "..shotgunammocap, player, 0, 125, 0 )
  701.         outputChatBox ( "MP5: "..BikerMP.." von "..mpcap, player, 0, 125, 0 )
  702.         outputChatBox ( "MP5 Magazine: "..BikerMPMunition.." von "..mpammocap, player, 0, 125, 0 )
  703.         outputChatBox ( "AK-47: "..BikerAK.." von "..akcap, player, 0, 125, 0 )
  704.         outputChatBox ( "Ak-47 Magazine "..BikerAKMunition.." von "..akammocap, player, 0, 125, 0 )
  705.         outputChatBox ( "M4: "..BikerM.." von "..mcap, player, 0, 125, 0 )
  706.         outputChatBox ( "M4 Magazine "..BikerMMunition.." von "..mammocap, player, 0, 125, 0 )
  707.         outputChatBox ( "Gewehre: "..BikerGewehre.." von "..gewehrcap, player, 0, 125, 0 )
  708.         outputChatBox ( "Gewehr Patronen: "..BikerGewehrPatronen.." von "..gewehrammocap, player, 0, 125, 0 )
  709.         outputChatBox ( "Scharfschuetzengewehre: "..BikerSGewehr.." von "..sgewehrcap, player, 0, 125, 0 )
  710.         outputChatBox ( "Scharfschuetzengewehr Patronen: "..BikerSGewehrMunition.." von "..sgewehrammocap, player, 0, 125, 0 )
  711.         outputChatBox ( "Raketenwerfer: "..BikerRaketenwerfer.." von "..raketenwerfercap, player, 0, 125, 0 )
  712.         outputChatBox ( "Raketen: "..BikerRaketen.." von "..raketencap, player, 0, 125, 0 )
  713.         outputChatBox ( "Uzis: "..BikerSpezwaffen.." von "..spezguncap, player, 0, 125, 0 )
  714.    elseif isGrove(player) then
  715.         outputChatBox ( "Bestand:", player, 0, 0, 125 )
  716.         outputChatBox ( "Schlagringe: "..GroveSchlagringe.." von "..baseballcap, player, 0, 125, 0 )
  717.         outputChatBox ( "Baseballschlaeger: "..GroveBaseballschlaeger.." von "..baseballcap, player, 0, 125, 0 )
  718.         outputChatBox ( "Messer: "..GroveMesser.." von "..knifecap, player, 0, 125, 0 )
  719.         outputChatBox ( "Schaufeln: "..GroveSchaufeln.." von "..shovelscap, player, 0, 125, 0 )
  720.         outputChatBox ( "Pistolen: "..GrovePistolen.." von "..pistolcap, player, 0, 125, 0 )
  721.         outputChatBox ( "SD-Pistolen: "..GroveSDPistolen.." von "..sdpistolcap, player, 0, 125, 0 )
  722.         outputChatBox ( "9mm Magazine: "..GrovePistolenMagazine.." von "..pistolammocap, player, 0, 125, 0 )
  723.         outputChatBox ( "Desert Eagles: "..GroveDesertEagles.." von "..eaglecap, player, 0, 125, 0 )
  724.         outputChatBox ( "Desert Eagle Magazine: "..GroveDesertEagleMunition.." von "..eagleammocap, player, 0, 125, 0 )
  725.         outputChatBox ( "Schrotflinten: "..GroveSchrotflinten.." von "..shotguncap, player, 0, 125, 0 )
  726.         outputChatBox ( "Schrotkugeln: "..GroveSchrotflintenMunition.." von "..shotgunammocap, player, 0, 125, 0 )
  727.         outputChatBox ( "MP5: "..GroveMP.." von "..mpcap, player, 0, 125, 0 )
  728.         outputChatBox ( "MP5 Magazine: "..GroveMPMunition.." von "..mpammocap, player, 0, 125, 0 )
  729.         outputChatBox ( "AK-47: "..GroveAK.." von "..akcap, player, 0, 125, 0 )
  730.         outputChatBox ( "Ak-47 Magazine "..GroveAKMunition.." von "..akammocap, player, 0, 125, 0 )
  731.         outputChatBox ( "M4: "..GroveM.." von "..mcap, player, 0, 125, 0 )
  732.         outputChatBox ( "M4 Magazine "..GroveMMunition.." von "..mammocap, player, 0, 125, 0 )
  733.         outputChatBox ( "Gewehre: "..GroveGewehre.." von "..gewehrcap, player, 0, 125, 0 )
  734.         outputChatBox ( "Gewehr Patronen: "..GroveGewehrPatronen.." von "..gewehrammocap, player, 0, 125, 0 )
  735.         outputChatBox ( "Scharfschuetzengewehre: "..GroveSGewehr.." von "..sgewehrcap, player, 0, 125, 0 )
  736.         outputChatBox ( "Scharfschuetzengewehr Patronen: "..GroveSGewehrMunition.." von "..sgewehrammocap, player, 0, 125, 0 )
  737.         outputChatBox ( "Raketenwerfer: "..GroveRaketenwerfer.." von "..raketenwerfercap, player, 0, 125, 0 )
  738.         outputChatBox ( "Raketen: "..GroveRaketen.." von "..raketencap, player, 0, 125, 0 )
  739.         outputChatBox ( "Uzis: "..GroveSpezwaffen.." von "..spezguncap, player, 0, 125, 0 )
  740.     elseif isCop ( player ) or isFBI ( player ) or isArmy ( player ) then
  741.         outputChatBox ( "Geld in der Fraktionskasse: "..MySQL_GetString("fraktionen", "DepotGeld", "ID LIKE '1'"), player, 200, 200, 0 )
  742.     end
  743. end
  744.  
  745. addCommandHandler ( "fstate", fstate_func )
  746.  
  747. function fskin_func ( player )
  748.    
  749.     local curskin = getElementModel ( player )
  750.     local faction = getPlayerFaction ( player )
  751.     local val = false
  752.    
  753.     if getPedOccupiedVehicle ( player ) then
  754.    
  755.         outputChatBox ( "Bitte nutze diesen Befehl nur ausserhalb von Fahrzeugen!", player, 125, 0, 0 )
  756.        
  757.     elseif faction == 1 and isOnDuty(player) and getElementModel ( player ) ~= 285 then
  758.    
  759.         for i, skin in pairs (factionSkins[1]) do
  760.        
  761.             if skin == getElementModel(player) then
  762.            
  763.                 val = i
  764.                 break
  765.                
  766.             end
  767.        
  768.         end
  769.        
  770.         if val == false or val == #factionSkins[1] then
  771.        
  772.             setElementModel ( player, factionSkins[1][1] )
  773.             return
  774.        
  775.         elseif val == 5 then
  776.        
  777.             setElementModel ( player, factionSkins[1][7] )
  778.             return
  779.        
  780.         else
  781.        
  782.             setElementModel ( player, factionSkins[1][val+1] )
  783.             return
  784.        
  785.         end
  786.            
  787.     elseif faction == 6 and isOnDuty(player) and getElementModel ( player ) ~= 285 then
  788.    
  789.         for i, skin in pairs (factionSkins[6]) do
  790.        
  791.             if skin == getElementModel(player) then
  792.            
  793.                 val = i
  794.                 break
  795.                
  796.             end
  797.        
  798.         end
  799.        
  800.         if val == false or val == #factionSkins[6] then
  801.        
  802.             setElementModel ( player, factionSkins[6][2] )
  803.             return
  804.                
  805.         else
  806.        
  807.             setElementModel ( player, factionSkins[6][val+1] )
  808.             return
  809.        
  810.         end
  811.        
  812.     elseif faction >= 1 and faction ~= 1 and faction ~= 6 then
  813.    
  814.         for i, skin in pairs (factionSkins[faction]) do
  815.        
  816.             if skin == getElementModel(player) then
  817.            
  818.                 val = i
  819.                 break
  820.                
  821.             end
  822.        
  823.         end
  824.        
  825.         if val == false or val == #factionSkins[faction] then
  826.        
  827.             setElementModel ( player, factionSkins[faction][1] )
  828.             vioSetElementData ( player, "skinid", factionSkins[faction][1] )
  829.             return
  830.                
  831.         else
  832.        
  833.             setElementModel ( player, factionSkins[faction][val+1] )
  834.             vioSetElementData ( player, "skinid", factionSkins[faction][val+1] )
  835.             return
  836.        
  837.         end
  838.  
  839.     else
  840.    
  841.         outputChatBox ( "Du darfst diesen Befehl nicht benutzen!", player, 125, 0, 0 )
  842.        
  843.     end
  844. end
  845.  
  846. addCommandHandler ( "fskin", fskin_func )
  847.  
  848.  
  849. function invite_func ( player, cmd, target )
  850.  
  851.     local faction = getPlayerFaction ( player )
  852.     local rank = getPlayerRank ( player )
  853.  
  854.     if faction ~= 0 and rank >= 5 then
  855.    
  856.         local target = findPlayerByName( target )
  857.        
  858.         if target ~= false then
  859.        
  860.             if getPlayerFaction( target ) == 0 then
  861.            
  862.                 if not isInGang ( getPlayerName ( target ) ) then
  863.                
  864.                     vioSetElementData ( target, "fraktion", faction )
  865.                     vioSetElementData ( target, "rang", 0 )
  866.                     fraktionMembers[faction][target] = faction
  867.                     outputChatBox ( "Du wurdest soeben in eine Fraktion aufgenommen! Tippe /t [Text] fuer den Chat und F1, um mehr zu erfahren!", target, 0, 125, 0 )
  868.                     outputChatBox ( "Du hast den Spieler "..getPlayerName(target).." in deine Fraktion aufgenommen!", player, 0, 125, 0 )
  869.                    
  870.                 else
  871.                
  872.                     infobox ( player, "\n\n\nDer Spieler ist\nin einer Gang!", 5000, 125, 0, 0 )
  873.                    
  874.                 end
  875.                
  876.             else
  877.            
  878.                 triggerClientEvent ( player, "infobox_start", getRootElement(), "Der Spieler ist\nbereits in\neiner Fraktion!", 5000, 125, 0, 0 )
  879.                
  880.             end
  881.            
  882.         else
  883.        
  884.             triggerClientEvent ( player, "infobox_start", getRootElement(), "\nUngueltiger\nSpieler!", 5000, 125, 0, 0 )
  885.            
  886.         end
  887.        
  888.     else
  889.    
  890.         triggerClientEvent ( player, "infobox_start", getRootElement(), "\nDu bist nicht\nbefugt!", 5000, 125, 0, 0 )
  891.        
  892.     end
  893.    
  894. end
  895.  
  896. addCommandHandler ( "invite", invite_func )
  897.  
  898. function uninvite_func ( player, cmd, target )
  899.  
  900.     local faction = getPlayerFaction ( player )
  901.     local rank = getPlayerRank ( player )
  902.  
  903.     if faction > 0 and rank >= 5 then
  904.    
  905.         local target = findPlayerByName( target )
  906.        
  907.         if target ~= false then
  908.        
  909.             if faction == getPlayerFaction( target ) and getPlayerRank ( target ) <= 4 then
  910.            
  911.                 local model = malehomeless[math.random ( 1, 5 )]
  912.                 setElementModel ( target, model )
  913.                 vioSetElementData ( target, "skinid", model )
  914.                
  915.                 vioSetElementData ( target, "rang", 0 )
  916.                 fraktionMembers[faction][target] = nil
  917.                 vioSetElementData ( target, "fraktion", 0 )
  918.                 outputChatBox ( "Du wurdest soeben aus deiner Fraktion geworfen!", target, 0, 125, 0 )
  919.                 MySQL_SetString ( "userdata", "LastFactionChange", timestampOptical (), "Name LIKE '"..getPlayerName(target).."'")
  920.                 outputChatBox ( "Du hast den Spieler "..getPlayerName(target).." aus deiner Fraktion entfernt!", player, 0, 125, 0 )
  921.                
  922.             else
  923.                 triggerClientEvent ( player, "infobox_start", getRootElement(), "Du kannst den\nSpieler nicht aus\nder Fraktion\nentfernen!", 5000, 125, 0, 0 )
  924.             end
  925.            
  926.         else
  927.        
  928.             triggerClientEvent ( player, "infobox_start", getRootElement(), "\nUngueltiger\nSpieler!", 5000, 125, 0, 0 )
  929.            
  930.         end
  931.        
  932.     else
  933.    
  934.         triggerClientEvent ( player, "infobox_start", getRootElement(), "\nDu bist nicht\nbefugt!", 5000, 125, 0, 0 )
  935.        
  936.     end
  937.    
  938. end
  939.  
  940. addCommandHandler ( "uninvite", uninvite_func )
  941.  
  942. function getchangestate_func ( player, cmd, target )
  943.  
  944.     local target = findPlayerByName( target )
  945.    
  946.     if isElement ( target ) then
  947.    
  948.         if vioGetElementData ( player, "adminlvl" ) >= 1 or vioGetElementData ( player, "rang" ) >= 4 then
  949.        
  950.             outputChatBox ( "Letzter Fraktions-Uninvite: "..tostring ( MySQL_GetString ( "userdata", "LastFactionChange", "Name LIKE '"..getPlayerName(target).."'") ), player, 200, 200, 0 )
  951.            
  952.         else
  953.        
  954.             outputChatBox ( "Du bist kein Admin/Leader/Coleader!", player, 125, 0, 0 )
  955.            
  956.         end
  957.        
  958.     else
  959.    
  960.         outputChatBox ( "Der Spieler ist nicht online!", player, 125, 0, 0 )
  961.        
  962.     end
  963.    
  964. end
  965.  
  966. addCommandHandler ( "getchangestate", getchangestate_func )
  967.  
  968. function giverank_func ( player, cmd, target, newrank )
  969.  
  970.     local newrank = math.abs ( math.floor ( tonumber ( newrank ) ) )
  971.     local target = findPlayerByName( target )
  972.     local faction = getPlayerFaction ( player )
  973.     local rank = getPlayerRank ( player )
  974.    
  975.     if target then
  976.    
  977.         local targetfaction = getPlayerFaction ( target )
  978.         local targetrank = getPlayerRank ( target )
  979.    
  980.         if faction >= 1 and rank >= 4 and faction == targetfaction and rank > newrank and targetrank ~= newrank then
  981.        
  982.             if newrank < 5 and newrank >= 0 then
  983.            
  984.                 if newrank > targetrank then
  985.                
  986.                     outputChatBox ( "Glueckwunsch, du wurdest soeben von "..getPlayerName ( player ).." zum "..factionRankNames[faction][newrank].." befoerdert!", target, 0, 125, 0 )
  987.                    
  988.                 else
  989.                
  990.                     outputChatBox ( "Du wurdest soeben von "..getPlayerName ( player ).." zum "..factionRankNames[faction][newrank].." degradiert!", target, 125, 0, 0 )
  991.                    
  992.                 end
  993.                
  994.                 vioSetElementData ( target, "rang", newrank )
  995.                 outputChatBox ( "Du hast "..getPlayerName(target).." soeben Rang "..factionRankNames[faction][newrank].." ( "..newrank.." ) gegeben!", player, 0, 125, 0 )
  996.                
  997.             end
  998.            
  999.         else
  1000.        
  1001.             triggerClientEvent ( player, "infobox_start", getRootElement(), "\nDu bist nicht\nbefugt!", 5000, 125, 0, 0 )
  1002.            
  1003.         end
  1004.    
  1005.     else
  1006.    
  1007.         triggerClientEvent ( player, "infobox_start", getRootElement(), "\nUngueltiger\nSpieler!", 5000, 125, 0, 0 )
  1008.        
  1009.     end
  1010.    
  1011. end
  1012.  
  1013. addCommandHandler ( "giverank", giverank_func )
Advertisement
Add Comment
Please, Sign In to add comment