Jump to content

Medic job(I need help)


Ryan123

Recommended Posts

why I don't see gui job?Someone can repair this script

Jefferson:

local marker = createMarker( 2035.1999511719, -1406.5, 16.200000762939, "Cylinder", 2, 6, 183, 248, 153) 
local skins = {"274", "275", "276"} 
  
function job () 
GUIEditor_Window[1] = guiCreateWindow(478,142,303,404,"Job Medic",false) 
GUIEditor_Button[1] = guiCreateButton(20,348,108,43,"Take Job",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(165,348,108,43,"Cancel",false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(18,31,268,188,"To take Medic team job, press Take job.\n\nIf you don't want to, press Cancel.",false,GUIEditor_Window[1]) 
GUIEditor_Grid[1] = guiCreateGridList(26,229,255,115,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
skins = guiGridListAddColumn(GUIEditor_Grid[1],"Skins",0.85) 
    for index, Skins in ipairs(Skins) do 
        local row = guiGridListAddRow (GUIEditor_Grid[1]) 
        guiGridListSetItemText ( GUIEditor_Grid[1], row, skins, tostring(IDSkins), false, false ) 
    end 
end 
  
for i,marker in ipairs(markers) do 
addEventHandler("onClientMarkerHit", marker, 
    function ( hitElement ) 
        if (hitElement == localPlayer) then 
            Job ( hitElement ) 
            if (MainGui ~= nil) then 
                guiSetVisible(MainGui, true) 
                showCursor(true) 
                guiSetInputEnabled(true) 
                setElementFrozen(hitElement, true) 
            end 
        end 
end 
) 
end 
  
  
addEventHandler("onClientGUIClick", root,  
function () 
        if (source == GUIEditor_Button[1]) then 
            local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) 
            if (row and col and row ~= -1 and col ~= -1) then 
                local vehicleName = guiGridListGetItemText(GUIEditor_Grid[1], row, 1) 
                if vehicleName == "274" then 
                    triggerServerEvent("spawn274",localPlayer,vehicleName) 
                elseif vehicleName == "275" then 
                    triggerServerEvent("spawn275",localPlayer,vehicleName) 
                elseif vehicleName == "276" then 
                    triggerServerEvent("spawn276",localPlayer,vehicleName) 
                end 
            else 
                outputChatBox("Error: Please, select a Skin of list.",255,0,0) 
            end 
            elseif (source == GUIEditor_Button[2]) then 
                triggerEvent("closeWindow", root ) 
        end 
end) 
  
addEventHandler("onClientGUIDoubleClick", root,  
function () 
        if ( source == GUIEditor_Grid[1] ) then 
                local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) 
            if (row and col and row ~= -1 and col ~= -1) then 
                local vehicleName = guiGridListGetItemText(GUIEditor_Grid[1], row, 1) 
                if vehicleName == "274" then 
                    triggerServerEvent("spawn274",localPlayer,vehicleName) 
                elseif vehicleName == "275" then 
                    triggerServerEvent("spawn275",localPlayer,vehicleName) 
                elseif vehicleName == "276" then 
                    triggerServerEvent("spawn276",localPlayer,vehicleName) 
                end 
            end 
        end 
end 
) 
  
for i,marker in ipairs(markers) do 
addEventHandler("onClientMarkerLeave", marker, 
function () 
        triggerEvent("closeWindow", root ) 
end 
) 
end 
  
addEventHandler("onClientPlayerWasted", root, 
function () 
        triggerEvent("closeWindow", root ) 
end 
) 
  
addEvent("closeWindow", true) 
addEventHandler("closeWindow", root,  
function () 
            guiSetVisible(MainGui, false) 
            showCursor(false) 
            guiSetInputEnabled(false) 
            setElementFrozen(localPlayer, false) 
end 
) 
  

Server:

function createMedicTeam () 
    MedicTeam = createTeam ("Emergency", 6, 183, 248) 
end 
addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) 
  
function joinMedic() 
     setPlayerTeam(source,MedicTeam) 
     setElementData( source, "Occupation", "Medic", true ) 
     outputChatBox("You are now Medic.",source,0,255,0) 
end 
addEvent("setMedic", true) 
addEventHandler("setMedic",root,joinMedic) 
  
addEvent("spawn274", true) 
addEventHandler("spawn274", root, 
function () 
    setElementData(source, 274) 
    triggerClientEvent("closeWindow", root) 
end 
) 
  
addEvent("spawn275", true) 
addEventHandler("spawn275", root, 
function () 
    setElementData(source, 275) 
    triggerClientEvent("closeWindow", root) 
end 
) 
  
addEvent("spawn276", true) 
addEventHandler("spawn276", root, 
function () 
    setElementData(source, 276) 
    triggerClientEvent("closeWindow", root) 
end 
) 

Link to comment
local marker = createMarker( 2035.1999511719, -1406.5, 16.200000762939, "Cylinder", 2, 6, 183, 248, 153) 
local skins = {"274", "275", "276"} 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Grid = {} 
function job () 
GUIEditor_Window[1] = guiCreateWindow(478,142,303,404,"Job Medic",false) 
GUIEditor_Button[1] = guiCreateButton(20,348,108,43,"Take Job",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(165,348,108,43,"Cancel",false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(18,31,268,188,"To take Medic team job, press Take job.\n\nIf you don't want to, press Cancel.",false,GUIEditor_Window[1]) 
GUIEditor_Grid[1] = guiCreateGridList(26,229,255,115,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
skins = guiGridListAddColumn(GUIEditor_Grid[1],"Skins",0.85) 
    for index, Skins in ipairs(Skins) do 
        local row = guiGridListAddRow (GUIEditor_Grid[1]) 
        guiGridListSetItemText ( GUIEditor_Grid[1], row, skins, tostring(IDSkins), false, false ) 
    end 
end 
  
for i,marker in ipairs(markers) do 
addEventHandler("onClientMarkerHit", marker, 
    function ( hitElement ) 
        if (hitElement == localPlayer) then 
            Job ( hitElement ) 
            if (MainGui ~= nil) then 
                guiSetVisible(MainGui, true) 
                showCursor(true) 
                guiSetInputEnabled(true) 
                setElementFrozen(hitElement, true) 
            end 
        end 
end 
) 
end 
  
  
addEventHandler("onClientGUIClick", root,  
function () 
        if (source == GUIEditor_Button[1]) then 
            local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) 
            if (row and col and row ~= -1 and col ~= -1) then 
                local vehicleName = guiGridListGetItemText(GUIEditor_Grid[1], row, 1) 
                if vehicleName == "274" then 
                    triggerServerEvent("spawn274",localPlayer,vehicleName) 
                elseif vehicleName == "275" then 
                    triggerServerEvent("spawn275",localPlayer,vehicleName) 
                elseif vehicleName == "276" then 
                    triggerServerEvent("spawn276",localPlayer,vehicleName) 
                end 
            else 
                outputChatBox("Error: Please, select a Skin of list.",255,0,0) 
            end 
            elseif (source == GUIEditor_Button[2]) then 
                triggerEvent("closeWindow", root ) 
        end 
end) 
  
addEventHandler("onClientGUIDoubleClick", root,  
function () 
        if ( source == GUIEditor_Grid[1] ) then 
                local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) 
            if (row and col and row ~= -1 and col ~= -1) then 
                local vehicleName = guiGridListGetItemText(GUIEditor_Grid[1], row, 1) 
                if vehicleName == "274" then 
                    triggerServerEvent("spawn274",localPlayer,vehicleName) 
                elseif vehicleName == "275" then 
                    triggerServerEvent("spawn275",localPlayer,vehicleName) 
                elseif vehicleName == "276" then 
                    triggerServerEvent("spawn276",localPlayer,vehicleName) 
                end 
            end 
        end 
end 
) 
  
for i,marker in ipairs(markers) do 
addEventHandler("onClientMarkerLeave", marker, 
function () 
        triggerEvent("closeWindow", root ) 
end 
) 
end 
  
addEventHandler("onClientPlayerWasted", root, 
function () 
        triggerEvent("closeWindow", root ) 
end 
) 
  
addEvent("closeWindow", true) 
addEventHandler("closeWindow", root,  
function () 
            guiSetVisible(MainGui, false) 
            showCursor(false) 
            guiSetInputEnabled(false) 
            setElementFrozen(localPlayer, false) 
end 
) 

:wink:

Link to comment
  • Moderators
You again with my client side code.

next time do not ask for help with scripts downloaded from a server.

You could compile them with

LUAC: viewtopic.php?f=108&t=33905

or

delete them when they're transferred to the client: viewtopic.php?f=148&t=43499

viewtopic.php?f=148&t=36847

I compile my scripts and use fileDelete, actually I made this script to a friend, I found my code here and asked him if he sent the script to someone, he said he did not.

Dont wanna start a fight because of this script, just do not like people who steal scripts.

Link to comment

lol, that's kinda tru but think about this...

you work so hard on your script then someone of another server comes and takes it just to make theirs better...

After when you release your server, some people are going to say you copied from another server, and you would tell them that they stole it from you but no one believes you

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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