Jump to content

[Help]Create simple job


Duvis777

Recommended Posts

Hello everyone wanted to see it if anyone can help me do some script work to build on the work and make more, I will use the mta-paradise roleplay gamemode but I have no ideas to add I found this script work but still do not understand very ben lua to edit the same way thanks for the help

I want serious job delivering pizza, or Hat

Client:

jobmarker = createMarker(1314,-1575,12,"cylinder",2,0,255,0) 
addEventHandler("onClientMarkerHit",jobmarker,function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(jobwindow,true) showCursor(true) end end) 
  
sx,sy = guiGetScreenSize() 
lp = getLocalPlayer() 
mr = math.random(1,2) 
jobwindow = guiCreateWindow(0.3*sx,0.3*sy,0.4*sx,0.4*sy,"Car Jacker",false) 
sx,sy = 0.5*sx,0.5*sy 
memo = guiCreateMemo(0*sx,0.05*sy,0.8*sx,0.6*sy,"Description here",false,jobwindow) 
takebutton = guiCreateButton(0.25,0.9,0.2,0.18,"Accept",true,jobwindow) 
cancbutton = guiCreateButton(0.55,0.9,0.2,0.18,"Cancel",true,jobwindow) 
guiSetVisible (jobwindow,false) 
guiMemoSetReadOnly(memo,true) 
guiWindowSetMovable (jobwindow,false ) 
guiWindowSetSizable (jobwindow,false ) 
  
addEventHandler("onClientGUIClick",jobwindow, 
function(b) 
    if b == "left" then 
        if source == takebutton then 
            if getTeamName(getPlayerTeam(lp)) ~= "Carjacker" then 
            triggerServerEvent("haveMonkeyJob",lp) 
            outputChatBox ("You are now now employed as a car jacker",255,255,0, true) 
            guiSetVisible(jobwindow,false) 
            showCursor(false) 
            end 
        elseif source == cancbutton then 
        guiSetVisible(jobwindow,false) 
        showCursor(false) 
        end 
    end 
end) 
  
addEventHandler("onClientMarkerHit",jobmarker, 
        function(p) 
             if p == lp and not isPedInVehicle(lp) then 
                 guiSetVisible(jobwindow,true) 
                showCursor(true) 
                if getTeamName(getPlayerTeam(lp)) == "Carjacker" then 
                outputChatBox ("You already have this job..",0,255,0, true) 
        guiSetVisible(jobwindow,false) 
        showCursor(false) 
        end 
    end 
end)  
  
addEvent("haveMonkeyJob",true) 

Server:

addEvent("haveMonkeyJob",true) -- adds the event 
function haveMonkeyJob() 
triggerClientEvent(source,"haveMonkeyJob",root,TheX,TheY) -- triggers the client event 
setPlayerTeam(source,getTeamFromName("Carjacker")) -- sets me in "Carjacker" team 
end 
addEventHandler("haveMonkeyJob",root,haveMonkeyJob) 

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...