Jump to content

[HELP] Scirpt


EL-JoKeR

Recommended Posts

not runing :)

Clinet

  
 
-----------------------------------------|
local rx,ry = guiGetScreenSize()
local sW,sH = 888,550
-----------------------------------------|
WindowKidnapperComputer = guiCreateWindow((rx/1.-- s8) -->-(sW/2),(ry/2)-(sH/2),sW,sH,"Kidnapper CP | جهاز الخطف",false)
LabesTextPlayerlist = guiCreateLabel(14,29,471,17,"الرتبة التالية : N/1",false,WindowKidnapperComputer)
guiSetFont(LabesTextPlayerlist,"default-small")
guiLabelSetColor(LabesTextPlayerlist,200,200,0)
GridListOfKidnapperC = guiCreateGridList(12,51,867,263,false,WindowKidnapperComputer)
guiGridListSetSelectionMode(GridListOfKidnapperC,0)
 
Column1 = guiGridListAddColumn(GridListOfKidnapperC,"اسم اللاعب",0.2)
Column2 = guiGridListAddColumn(GridListOfKidnapperC,"المنطقة",0.1)
Column3 = guiGridListAddColumn(GridListOfKidnapperC,"النجوم",0.2)
Column4 = guiGridListAddColumn(GridListOfKidnapperC,"نقاط الاجرام",0.2)
Column6 = guiGridListAddColumn(GridListOfKidnapperC,"المسافة إليه",0.2)
Column5 = guiGridListAddColumn(GridListOfKidnapperC,"وسيلة المواصلات",0.2)
 
LabelTextPlayerStat = guiCreateLabel(22,321,92,17,": بيانات الخاطف",false,WindowKidnapperComputer)
guiSetFont(LabelTextPlayerStat,"default-bold-small")
LabeTextAccountName = guiCreateLabel(23,342,92,20,": اسم الحساب",false,WindowKidnapperComputer)
guiLabelSetColor(LabeTextAccountName,200,100,0)
LabelAccountName = guiCreateLabel(116,342,181,20,"",false,WindowKidnapperComputer)
LabesTextArrestP = guiCreateLabel(23,382,87,20,": نقاط الخطف",false,WindowKidnapperComputer)
guiLabelSetColor(LabesTextArrestP,200,100,0)
LabesTextArrests = guiCreateLabel(23,402,56,20,": المخطوفين",false,WindowKidnapperComputer)
guiLabelSetColor(LabesTextArrests,200,100,0)
LabelTextRank = guiCreateLabel(23,421,36,20,": الرتبة",false,WindowKidnapperComputer)
guiLabelSetColor(LabelTextRank,200,100,0)
 
----------------------------------------------|
--RadioMorethen2 = guiCreateRadioButton(320,342,177,22,"إظهار المطلوبين فوق نجمتين",false,WindowKidnapperComputer)
--RadioMorethen3 = guiCreateRadioButton(320,377,177,22,"إظهار المطلوبين فوق 3 نجوم",false,WindowKidnapperComputer)
--RadioMorethen4 = guiCreateRadioButton(320,412,177,22,"إظهار المطلوبين فوق 4 نجوم",false,WindowKidnapperComputer)
--RadioMorethen5 = guiCreateRadioButton(320,446,177,22,"إظهار المطلوبين فوق 5 نجوم",false,WindowKidnapperComputer)
--RadioMorethen6 = guiCreateRadioButton(320,478,183,22,"إظهار المطلوبين 6 نجوم",false,WindowKidnapperComputer)
guiRadioButtonSetSelected(RadioMorethen2,true)
----------------------------------------------|
 
LabelTextPlayTime = guiCreateLabel(23,362,60,20,": وقت اللعب",false,WindowKidnapperComputer)
guiLabelSetColor(LabelTextPlayTime,200,100,0)
LabelText5at = guiCreateLabel(300,321,9,191,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|",false,WindowKidnapperComputer)
LabelTetCopRadio = guiCreateLabel(321,321,92,17,": خيارات الخاطف",false,WindowKidnapperComputer)
guiSetFont(LabelTetCopRadio,"default-bold-small")
GridListTopPlayers = guiCreateGridList(510,355,369,112,false,WindowKidnapperComputer)
guiGridListSetSelectionMode(GridListTopPlayers,2)
 
Column11 = guiGridListAddColumn(GridListTopPlayers,"الخاطفين",0.3)
Column22 = guiGridListAddColumn(GridListTopPlayers,"المخطوفين",0.2)
Column33 = guiGridListAddColumn(GridListTopPlayers,"نقاط",0.2)
 
--ButtonRequestingPilotorTaxi = guiCreateButton(11,506,286,28,"طلب سيارة أجرة",false,WindowKidnapperComputer)
--ButtonRequestArmy           = guiCreateButton(11,475,286,28,"ARMY طلب تعزيزات من فريق",false,WindowKidnapperComputer)
--ButtonRequestSWAT           = guiCreateButton(11,444,286,28,"SWAT طلب تعزيزات من فريق",false,WindowKidnapperComputer)
ButtonRemoveAllPlayerSelected = guiCreateButton(648,318,132,35,"إلغاء جميع العلامات",false,WindowKidnapperComputer)
ButtonMarkPlayerSelected = guiCreateButton(510,318,132,35,"وضع علامة على اللاعب",false,WindowKidnapperComputer)
ButtonMarkAllPlayers = guiCreateButton(510,471,286,35,"وضع علامة للجميع",false,WindowKidnapperComputer)
ButtonCloseWindow = guiCreateButton(510,506,286,30,"إغلاق",false,WindowKidnapperComputer)
 
LabelPlaytime = guiCreateLabel(83,362,209,20,"",false,WindowKidnapperComputer)
LabelArrestPoints = guiCreateLabel(107,382,188,20,"",false,WindowKidnapperComputer)
LabelArrest = guiCreateLabel(76,402,222,20,"",false,WindowKidnapperComputer)
LabelRank = guiCreateLabel(62,421,232,20,"",false,WindowKidnapperComputer)
 
guiWindowSetSizable(WindowKidnapperComputer,false)
guiSetVisible(WindowKidnapperComputer, false)
 
----| Events |--------------|
 
----------------------------|
 
 
bindKey ( "F5", "down",
function ()
if ((getTeamName(getPlayerTeam(localPlayer)) == "Criminals") and (getElementData(localPlayer, "Occupation") == "Kidnapper")) then
        if guiGetVisible(WindowKidnapperComputer) then
            guiSetVisible(WindowKidnapperComputer, false)
            showCursor(false,false)
          else
          triggerServerEvent ( "getKiddnaperStats", localPlayer )
        end
    end
end)
 
 
 
function onUserChangePanelSetting ()
    if ( source == RadioMorethen2 ) or ( source == RadioMorethen3 ) or ( source == RadioMorethen4 ) or ( source == RadioMorethen5 ) or ( source == RadioMorethen6 ) then
        loadWantedPlayers()
    end
end
addEventHandler ( "onClientGUIClick", root, onUserChangePanelSetting )
 
 
addEvent( "onOpenKidnapperPanel", true )
addEventHandler( "onOpenKidnapperPanel", root,
function ( kidnapped, kidnappedPoints, theRankp, nextRankp )
            guiSetText( LabelAccountName, "".. tostring(getElementData(localPlayer, "AccountName")) .."" )
           guiSetText( LabelPlaytime, ""..getElementData(localPlayer, "Play Time").."" )
           guiSetText( LabelArrest, ""..kidnapped )
           guiSetText( LabelArrestPoints, ""..kidnappedPoints )
           guiSetText( LabelRank, ""..theRankp )
           guiSetText( LabesTextPlayerlist, "Next rank : "..nextRankp )
           guiSetVisible(WindowKidnapperComputer,true)
           showCursor(true,true)
           loadWantedPlayers()
end)
 
local blips = {}
 
function loadWantedPlayers ()
    local WantedLevel = 0
    local x, y, z = getElementPosition(localPlayer)
    if ( guiRadioButtonGetSelected( RadioMorethen2 ) ) then
    WantedLevel = 2
    end
    if ( guiRadioButtonGetSelected( RadioMorethen3 ) ) then
    WantedLevel = 3
    end
    if ( guiRadioButtonGetSelected( RadioMorethen4 ) ) then
    WantedLevel = 4
    end
    if ( guiRadioButtonGetSelected( RadioMorethen5 ) ) then
    WantedLevel = 5
    end
    if ( guiRadioButtonGetSelected( RadioMorethen6 ) ) then
    WantedLevel = 5  
    end
        local playersFound = false
       
    guiGridListClear ( GridListOfKidnapperC )
    for ent, thePlayer in pairs(getElementsByType("player")) do
    local tx, ty, tz = getElementPosition(thePlayer)
        local distance = tostring(math.floor(getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)))
         if (getElementInterior(thePlayer) ~= 0) then distance = "N/A" end
            if ( WantedLevel == 0 ) then
                if ( getElementData( thePlayer, "WL" ) ) and ( getElementData( thePlayer, "WL" ) >= 0 ) then
                        local row = guiGridListAddRow ( GridListOfKidnapperC )
                        playersFound = true
                        if ( isPedInVehicle( thePlayer ) ) then transport = ""..getVehicleName(getPedOccupiedVehicle ( thePlayer )).."" else transport = "On Foot" end
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column1, getPlayerName ( thePlayer ), false, false )
                        guiGridListSetItemColor ( GridListOfKidnapperC, row, Column1, 255, 255, 0 )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column2, getElementData( thePlayer, "City" ), false, false )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column3, getElementData( thePlayer, "WL" ), false, false )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column4, getElementData( thePlayer, "wantedPoints" ), false, false )
                        guiGridListSetItemColor ( GridListOfKidnapperC, row, Column4, 255, 0, 0 )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column5, transport, false, false ) 
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column6, distance, false, false )   
                     if blips[thePlayer] ~= nil and isElement(blips[thePlayer]) == true then
                            for i=1,6 do
                                guiGridListSetItemColor(GridListOfKidnapperC,row,i,0,10,200)
                            end
                        end
                    end
            else
                if ( getElementData( thePlayer, "WL" ) ) and ( tonumber(getElementData( thePlayer, "WL" )) >= tonumber(WantedLevel) ) then
                    local row = guiGridListAddRow ( GridListOfKidnapperC )
                    playersFound = true
                        if ( isPedInVehicle( thePlayer ) ) then transport = ""..getVehicleName(getPedOccupiedVehicle ( thePlayer )).."" else transport = "On Foot" end
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column1, getPlayerName ( thePlayer ), false, false )
                        guiGridListSetItemColor ( GridListOfKidnapperC, row, Column1, 255, 255, 0 )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column2, getElementData( thePlayer, "City" ), false, false )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column3, getElementData( thePlayer, "WL" ), false, false )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column4, getElementData( thePlayer, "wantedPoints" ), false, false )
                        guiGridListSetItemColor ( GridListOfKidnapperC, row, Column4, 255, 0, 0 )
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column5, transport, false, false ) 
                        guiGridListSetItemText ( GridListOfKidnapperC, row, Column6, distance, false, false )
                        if blips[thePlayer] ~= nil and isElement(blips[thePlayer]) == true then
                            for i=1,6 do
                                guiGridListSetItemColor(GridListOfKidnapperC,row,i,0,10,200)
                            end
                        end                    
                 end
          end  
    end
    if not ( playersFound ) then
        local row = guiGridListAddRow ( GridListOfKidnapperC )
        guiGridListSetItemText ( GridListOfKidnapperC, row, 1, "No players found", false, false )
        guiGridListSetItemText ( GridListOfKidnapperC, row, 2, "N/A", false, false )
        guiGridListSetItemText ( GridListOfKidnapperC, row, 3, "N/A", false, false )
        guiGridListSetItemText ( GridListOfKidnapperC, row, 4, "N/A", false, false )
        guiGridListSetItemText ( GridListOfKidnapperC, row, 5, "N/A", false, false )
        guiGridListSetItemText ( GridListOfKidnapperC, row, 6, "N/A", false, false )
    end
end
 
function onMarkAllPlayers()
        local WantedLevel = 0
    if ( guiRadioButtonGetSelected( RadioMorethen2 ) ) then
    WantedLevel = 2
    end
    if ( guiRadioButtonGetSelected( RadioMorethen3 ) ) then
    WantedLevel = 3
    end
    if ( guiRadioButtonGetSelected( RadioMorethen4 ) ) then
    WantedLevel = 4
    end
    if ( guiRadioButtonGetSelected( RadioMorethen5 ) ) then
    WantedLevel = 5
    end
    if ( guiRadioButtonGetSelected( RadioMorethen6 ) ) then
    WantedLevel = 5  
    end
    local x, y, z = getElementPosition(localPlayer)
   
    for id, player in ipairs(getElementsByType("player")) do
        if ( player ~= localPlayer ) and (blips[player] == nil or blips[player] == false) then
            if getElementData(player,"isPlayerJailed") == false then
 
            if ( WantedLevel == 0 ) then
                if ( getElementData( player, "WL" ) ) and ( getElementData( player, "WL" ) ~= 0 ) then
                    local theBlip = createBlipAttachedTo ( player, 59 )
                    blips[player]=theBlip
                end
            else
                if ( getElementData( player, "WL" ) ) and ( getElementData( player, "WL" ) >= WantedLevel ) then
                    local theBlip = createBlipAttachedTo ( player, 59 )
                    blips[player]=theBlip
                end
            end
 
            end
        end
    end
    loadWantedPlayers()
end
 
---------------------------|| Select Mark Player ||---------------------------||
 
 
function OnClick(button,state)
 if (source == ButtonRequestArmy) then
     local services = "ARMY"
     triggerServerEvent ("onCopRequestRFS", localPlayer, services) 
 end
 if (source == ButtonRequestSWAT) then
      local services = "SWAT"
      triggerServerEvent ("onCopRequestRFS", localPlayer, services) 
   end
 if (source == ButtonRequestingPilotorTaxi) then
      local services = "TR"
      triggerServerEvent ("onCopRequestRFS", localPlayer, services) 
   end
end
addEventHandler ("onClientGUIClick", root, OnClick)
 
 
function onRemoveAllBlips ()
    for k,v in
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...