Jump to content

Need help with my Job


AlexWo

Recommended Posts

Posted

Hi I made a "Hacker-Job"

but it isn't working.... I got a console Error:

Here is a Link to the screenshot:

http://www.abload.de/image.php?img=errorj7jz4.png

Would be nice if you could look over it and tell me what is wrong.

Server Side

addEvent("Bank", true) 
addEventHandler("Bank", root, 
function Bank() 
setElementFrozen(localPlayer, true) 
outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) 
end 
setTimer ( hacked, 300000, 1) 
) 
  
addEvent("hacked", true) 
addEventHandler("hacked", root, 
function hacked() 
givePlayerMoney (localPlayer, 10000) 
setElementFrozen(localPlayer, false) 
setPlayerWantedLevel ( localPlayer, 3 ) 
end 
) 

Client:

 HackerMarker = createMarker ( 2511, -1246, 35, "cylinder", 1.5, 255, 255, 0, 255 ) 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
  
 local screenX, screenY = guiGetScreenSize() 
local width, height = 600, 600 
local x = (screenX/2) - (width/2) 
local y = (screenY/2) - (height/2) 
  
 function HackerWindow() 
HackWindow = guiCreateWindow(x,y,width,height,"Hacker-Job",false) 
guiWindowSetSizable(HackWindow,false) 
guiSetVisible(HackWindow, false) 
Hacker = guiCreateLabel(0.02,0.07,0.5,0.2,"Choose what you want to hack",true,HackWindow) 
button1 = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Bank", true,HackWindow ) 
end 
addEvent ("HackerWindow",true) 
addEventHandler ("HackerWindow",getResourceRootElement(getThisResource()),HackerWindow) 
  
function HackerWindowDestroy() 
    destroyElement(HackerWindow) HackerWindow = false 
    showCursor (false) 
end 
  
function HackerWindowClick() 
   if source == button1 then 
        triggerServerEvent ("Bank",getLocalPlayer()) 
        HackWindowDestroy () 
   elseif source == button2 then 
        HackerWindowDestroy () 
    end 
end 
addEventHandler("onClientGUIClick",getRootElement(),HackerWindowClick) 
  

Posted
addEvent("Bank", true) 
function Bank(thePlayer) 
setElementFrozen(thePlayer, true) 
outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) 
end 
addEventHandler("Bank", root, Bank) 
setTimer ( hacked, 300000, 1) 
  
addEvent("hacked", true) 
function hacked(thePlayer) 
givePlayerMoney (thePlayer, 10000) 
setElementFrozen(thePlayer, false) 
setPlayerWantedLevel ( thePlayer, 3 ) 
end 
addEventHandler("hacked", root, hacked) 

Posted

ok tryed this... but now its sais:

setTimer[Expected fuction at Argument 1, got nil]

well but "hacked" is the function...

IDK maybe you know that aswell?

Posted

Server Side

addEvent("Bank", true) 
addEventHandler("Bank", root, 
function Bank() 
setElementFrozen(localPlayer, true) 
outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) 
end 
) 
  
addEvent("hacked", true) 
addEventHandler("hacked", root, 
function hacked() 
givePlayerMoney (localPlayer, 10000) 
setElementFrozen(localPlayer, false) 
setPlayerWantedLevel ( localPlayer, 3 ) 
end 
setTimer ( hacked, 300000, 1 ) 
) 

Client:

 HackerMarker = createMarker ( 2511, -1246, 35, "cylinder", 1.5, 255, 255, 0, 255 ) 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
  
 local screenX, screenY = guiGetScreenSize() 
local width, height = 600, 600 
local x = (screenX/2) - (width/2) 
local y = (screenY/2) - (height/2) 
  
 function HackerWindow() 
HackWindow = guiCreateWindow(x,y,width,height,"Hacker-Job",false) 
guiWindowSetSizable(HackWindow,false) 
guiSetVisible(HackWindow, false) 
Hacker = guiCreateLabel(0.02,0.07,0.5,0.2,"Choose what you want to hack",true,HackWindow) 
button1 = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Bank", true,HackWindow ) 
end 
addEvent ("HackerWindow",true) 
addEventHandler ("HackerWindow",getResourceRootElement(getThisResource()),HackerWindow) 
  
function HackerWindowDestroy() 
    destroyElement(HackerWindow) HackerWindow = false 
    showCursor (false) 
end 
  
function HackerWindowClick() 
   if source == button1 then 
        triggerServerEvent ("Bank",getLocalPlayer()) 
        HackWindowDestroy () 
   elseif source == button2 then 
        HackerWindowDestroy () 
    end 
end 
addEventHandler("onClientGUIClick",getRootElement(),HackerWindowClick) 
  

try it

Posted

im talking about: you create the function with name Bank

you create the event and eventHandler with name Bank

you make the same things with hacked

Posted

Server

addEvent("Bank", true) 
addEventHandler("Bank", root, 
function Bank() 
setElementFrozen(localPlayer, true) 
outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) 
end 
) 
  
addEvent("hacked", true) 
addEventHandler("hacked", root, 
function hacked() 
givePlayerMoney (localPlayer, 10000) 
setElementFrozen(localPlayer, false) 
setPlayerWantedLevel ( localPlayer, 3 ) 
end 
setTimer ( hacked, 300000, 1 ) 
) 

Client:

HackerMarker = createMarker ( 2511, -1246, 35, "cylinder", 1.5, 255, 255, 0, 255 ) 
addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) 
  
 local screenX, screenY = guiGetScreenSize() 
local width, height = 600, 600 
local x = (screenX/2) - (width/2) 
local y = (screenY/2) - (height/2) 
  
 function HackerWindow() 
HackWindow = guiCreateWindow(x,y,width,height,"Hacker-Job",false) 
guiWindowSetSizable(HackWindow,false) 
guiSetVisible(HackWindow, false) 
Hacker = guiCreateLabel(0.02,0.07,0.5,0.2,"Choose what you want to hack",true,HackWindow) 
button1 = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Bank", true,HackWindow ) 
end 
addEvent ("HackerWindow",true) 
addEventHandler ("HackerWindow",getResourceRootElement(getThisResource()),HackerWindow) 
  
function HackerWindowDestroy() 
    destroyElement(HackerWindow) HackerWindow = false 
    showCursor (false) 
end 
  
function HackerWindowClick() 
   if source == button1 then 
        triggerServerEvent ("Bank",getLocalPlayer()) 
        HackWindowDestroy () 
   elseif source == button2 then 
        HackerWindowDestroy () 
    end 
end 
addEventHandler("onClientGUIClick",getRootElement(),HackerWindowClick) 
  

Posted
function Bank() 
setElementFrozen(localPlayer, true) 
outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) 
end 
addEvent("Bank", true) 
addEventHandler("Bank", root, Bank) 
  
function hacked() 
givePlayerMoney (localPlayer, 10000) 
setElementFrozen(localPlayer, false) 
setPlayerWantedLevel ( localPlayer, 3 ) 
setTimer ( hacked, 300000, 1 ) 
end 
addEvent("hacked", true) 
addEventHandler("hacked", root, hacked) 

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