Jump to content

Price.

Members
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Price.

  1. Price.

    Job [HELP]

    i removed @ line 55, no timer , peds doesn't appear after i kill one. gets aborted , "error aborting, infinite running script" warning: client.lua : line 55: bad argument @ removeEventHandler expected argument at argument 2.
  2. Price.

    Job [HELP]

    any help :\????
  3. did you try debugging it? any errors at all? mention them please. also try making a table would work better than this
  4. Price.

    HELP

    if client then use getPlayerAccount setAccountData
  5. Price.

    Job [HELP]

    hello so now after some stuff was added the timer goes infinite loop, keeps counting and doesn't stop little help would be appreciated :\ CLIENT: local isDx = false local sx,sy = guiGetScreenSize ( ) remainingTimeK = 15 l_tick = getTickCount ( ) local doCountdown = true Jobtable = { {228, 1315.4921875, -898.7529296875, 39.578125}, {228, 1178.515625, -2036.8623046875, 69.0078125}, {228, 2432.904296875, -1584.7587890625, 13.753595352173}, {228, 475.8759765625, -1279.939453125, 16.483493804932}, {228, 2491.4052734375, -2499.5556640625, 13.655031204224}, } weps = { 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 38, 16 } function dxInterface ( ) m = remainingTimeK local minutes = 0 while tonumber(m) <= 60 do m = m - 60 minutes = minutes + 1 end if not isDx then addEventHandler ("onClientRender", root, dxInterface ) else end isDx = true dxDrawText ( minutes..":"..m, 0, 0, (sx/1.1)+2, (sy/1.1)+2, tocolor ( 0, 0, 0, 255 ), 2.5, 'default-bold', 'center', 'top' ) dxDrawText ( minutes..":"..m, 0, 0, sx/1.1, sy/1.1, tocolor ( 255, 255, 0, 255 ), 2.5, 'default-bold', 'center', 'top' ) if ( doCountdown and getTickCount ( ) - l_tick >= 1000 ) then remainingTimeK = remainingTimeK - 1 l_tick = getTickCount ( ) if ( remainingTimeK == 0 ) then doCountdown = false end end end function fetchRandomOnStart_Handler( ) local skin, x, y, z = unpack ( Jobtable[math.random(#Jobtable)] ) ped = createPed ( skin, x, y, z ) blip = createBlipAttachedTo ( ped, 1, 0, 0, 0, 255 ) countdown = setTimer ( deleteTarget, 180000, 1 ) addEventHandler ("onClientPedWasted", ped, PedMoney ) dxInterface ( ) end addEvent ( "onAssStart", true ) addEventHandler ( "onAssStart", root, fetchRandomOnStart_Handler ) function deleteTarget ( ) destroyElement ( ped ) destroyElement ( blip ) killTimer ( countdown ) fetchRandomOnStart_Handler ( ) removeEventHandler ( "onClientPedWasted", ped, PedMoney ) removeEventHandler ( "onClientRender", root, dxInterface ) end function PedMoney ( attacker, attackerweapon, bodypart, loss ) local theTeam = getPlayerTeam ( attacker ) local theWL = getPlayerWantedLevel ( attacker ) local theSkin = getElementModel ( attacker ) for _, v in ipairs ( weps ) do if attackerweapon == v then if getTeamName( theTeam ) == "Criminal" then deleteTarget ( ) givePlayerMoney ( 100 ) end end end end local pedjob = createPed(249, 1721.1484375, -1121.4775390625, 24.085935592651, 180.0) local blipjob = createBlip (1721.1484375, -1121.4775390625, 24.085935592651 , 23, 2, 0, 0, 255, 255, 0, 500) addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler ("onClientMarkerHit", resourceRoot, drawGUIassass) end ) function drawGUIassass( ) if getPlayerTeam ( localPlayer ) ~= getTeamFromName ( "Criminal" ) then showCursor(true) assasswindow = guiCreateWindow(542, 220, 493, 475, "Assassinator Job", false) guiWindowSetSizable(assasswindow, false) guiSetAlpha(assasswindow, 0.97) titleimage = guiCreateStaticImage(10, 20, 473, 99, "images/assass.png", false, assasswindow) descmemo = guiCreateMemo(44, 135, 402, 291, "Be an assassinator and kill famous persons to get money!\n\nDecide carefully if you want to go this way:\nKilling people is illegal and you will get wanted!\n\nAlso make sure that you have got enought ammo.", false, assasswindow) guiSetAlpha(descmemo, 0.93) guiMemoSetReadOnly(descmemo, true) acceptbutton = guiCreateStaticImage(236, 434, 117, 25, "images/assass_ac.png", false, assasswindow) cancelbutton = guiCreateStaticImage(353, 434, 117, 25, "images/assass_ca.png", false, assasswindow) addEventHandler("onClientGUIClick", acceptbutton, startassassjob) addEventHandler("onClientGUIClick", cancelbutton, cancelassassjob) else outputChatBox ( "You are already employed as an Assassinator!" ) end end addEvent ( "assGuiVisible", true ) addEventHandler ( "assGuiVisible", root, drawGUIassass ) function cancelassassjob() guiSetVisible(assasswindow, false) showCursor(false) end function startassassjob() guiSetVisible(assasswindow, false) showCursor(false) triggerServerEvent ( "AssassStart", localPlayer, "team" ) fetchRandomOnStart_Handler ( ) end
  6. Price.

    Job [Help]

    u did output them but... no message gets out neither position , i need blips too bec idk where those pos are nothing in debugscript 3
  7. Price.

    Job [Help]

    what about the blip? i mean how can i go to that place I must make a blip
  8. Price.

    Job [Help]

    Well actually i was making a creative job... to spawn peds in random positions and when they got killed they you get wanted point and money ... the problem is i can't make a blip attached to those random positions. Server: Jobtable = { {1315.4921875, -898.7529296875, 39.578125, 228}, {1178.515625, -2036.8623046875, 69.0078125, 228}, {2432.904296875, -1584.7587890625, 13.753595352173, 228}, {475.8759765625, -1279.939453125, 16.483493804932, 228}, {2491.4052734375, -2499.5556640625, 13.655031204224,228} } function table() for index, player in ipairs ( players ) do local Job = unpack(Jobtable[math.random(#Jobtable)]) local myPed = getRandomPed() local x, y, z = getElementPosition( myPed ) local myBlip = createBlip( x, y, z, 1, 0, 0, 0, 255, myPed ) end end function PedMoney ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 22 or attackerweapon == 23 or attackerweapon == 24 or attackerweapon == 25 or attackerweapon == 26 or attackerweapon == 27 or attackerweapon == 28 or attackerweapon == 29 or attackerweapon == 32 or attackerweapon == 30 or attackerweapon == 31 or attackerweapon == 33 or attackerweapon == 34 or attackerweapon == 38 or attackerweapon == 16 ) then if getTeamName( theTeam ) == "Criminal" then theName = getPlayerName ( source ) thePed = getPlayerName ( attacker ) local playeraccount = getPlayerAccount ( attacker ) givePlayerMoney = {math.random (100,500)} setPlayerWantedLevel (source, 1) end end end end addEventHandler ("onPlayerDamage", getRootElement(), PedMoney) note: that blip thingy i added is not working, and that 228 beside positions are the peds idk if that would work, if not a little help :\?
  9. oh ok, thx for the tip thx so much
  10. worked, thx so much
  11. there is no debugscript 3 or errors.
  12. working, but now the houses doesnt appear after i rob first house?
  13. this robber job got problem whenever i start it , it tells me @line 41 '=' expected near 'jobwindow' what iam trying to do is to make a math.random @ houses so when i rob a house other appears on map and so on Client Side: robberHouses = { { 1887, -1113, 25 }; { 2092, -1160, 25 }; { 1896, -1165, 22 }; { 2068, -1720, 13 }; { 1970, -1671, 17 }; { 1895, -1071, 23 }; { 1940, -1066, 23 }; { 1955, -1074, 23 }; { 1960, -1069, 23 }; { 1956, -1115, 26 }; { 1945, -1115, 26 }; { 1924, -1115, 26 }; { 1900, -1114, 26 }; { 2596, -1237, 47 }; { 2595, -1199, 58 }; { 2516, -1028, 69 }; { 2630, -1072, 68 }; { 2794, -1246, 45 }; { 2809, -1176, 25 }; { 2586, -953, 80 }; } function unpackRobberHouses () return unpack ( robberHouses [ math.random ( #robberHouses ) ] ) end addEventHandler("onResourceStart", root, unpackrobberHouses) jobmarker = createMarker( 2054.4609375, -1759.5224609375, 13.549641609192, "cylinder", 1.5, 255, 153, 0, 150 ) createBlip ( 2054.4609375, -1759.5224609375, 13.549641609192, 52 ) addEventHandler("onResourceStart",jobmarker,function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(jobmarker,true) showCursor(true) end end) sx,sy = guiGetScreenSize() lp = getLocalPlayer() mr = math.random(1,2) e jobwindow = guiCreateWindow(0.3*sx,0.3*sy,0.4*sx,0.4*sy,"Criminal",false) sx,sy = 0.5*sx,0.5*sy memo = guiCreateMemo(0*sx,0.05*sy,0.8*sx,0.6*sy,"This is house robbing job press Accept and then a red house will appear on your minimap go to the red house blip and rob the house!",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)) ~= "Criminal" then triggerServerEvent ( "HaveCriminalJob", lp) outputChatBox ("You are now now employed as a Criminal",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) -- sets the cursor visible if getTeamName(getPlayerTeam(lp)) == "Criminal" then outputChatBox ("You already have this job..",0,255,0, true) guiSetVisible(jobwindow,false) showCursor(false) end end end) addEvent("HaveCriminalJob", true) function createHouses () x, y, z = unpackRobberHouses () robhouseMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) robhouseBlip = createBlipAttachedTo ( robhouseMarker, 32, localPlayer ) end addEventHandler ( "HaveCriminalJob", root, createHouses ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerEvent ( "createHouseEvent", localPlayer ) end end ) addEventHandler ( "onClientPedDamage", resourceRoot, function () cancelEvent () end )
  14. wow this is awesome, thx bro!
  15. oh nvm its working absolutly great, but uhm just a question this means if there is a Criminal team so it will turn me to Criminal?
  16. oh nvm its working absolutly great, but uhm just a question this means if there is a Criminal team so it will turn me to Criminal?
  17. I copied the whole server script u gave me and replaced it with the one i have still no blip
  18. thx but the blip is not working
  19. where should i put it, it should be in the server side since setplayerwantedlevel is a server side function but where ? which line?
  20. wow really helped but uhm i wanna make some random wanted system if i robbed i get 2 stars do i use setPlayerWantedLevel ??? also how to use it ? i want the anyone when robbing house gets 2 stars in the first robbing then keeps getting 1 more every rob.
  21. got another problem the whole job doesn't work its robbing house job when i take the job i see marked houses on map go to it and rob it but its not working at all Server function HaveCriminalJob() triggerClientEvent(source,"HaveCriminalJob",root,TheX,TheY) setPlayerTeam(source,getTeamFromName("Criminal")) end addEvent ( "HaveCriminalJob", true) addEventHandler("HaveCriminalJob", root, HaveCriminalJob) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () money = math.random ( 150, 2500 ) givePlayerMoney ( source, money ) outputChatBox ( "You successfully robbed the house and made $" ..money, source ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 2500, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay ) Client local robberHouses = { { 1887, -1113, 25 }; { 2092, -1160, 25 }; { 1896, -1165, 22 }; { 2068, -1720, 13 }; { 1970, -1671, 17 }; { 1895, -1071, 23 }; { 1940, -1066, 23 }; { 1955, -1074, 23 }; { 1960, -1069, 23 }; -- add whit { x,y, z}; { 1956, -1115, 26 }; { 1945, -1115, 26 }; { 1924, -1115, 26 }; { 1900, -1114, 26 }; { 2596, -1237, 47 }; { 2595, -1199, 58 }; { 2516, -1028, 69 }; { 2630, -1072, 68 }; { 2794, -1246, 45 }; { 2809, -1176, 25 }; { 2586, -953, 80 }; } function unpackRobberHouses () return unpack ( robberHouses [ math.random ( #robberHouses ) ] ) end jobmarker = createMarker( 2054.4609375, -1759.5224609375, 13.549641609192, "cylinder", 1.5, 255, 153, 0, 150 ) addEventHandler("onResourceStart",jobmarker,function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(jobmarker,true) showCursor(true) end end) sx,sy = guiGetScreenSize() -- creates a variable lp = getLocalPlayer() -- creates a variable mr = math.random(1,2) -- creates a variable jobwindow = guiCreateWindow(0.3*sx,0.3*sy,0.4*sx,0.4*sy,"Criminal",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) -- makes the gui unvisible guiMemoSetReadOnly(memo,true) -- makes so the memo text cannot be edited. guiWindowSetMovable (jobwindow,false ) -- makes to the window is not moveable guiWindowSetSizable (jobwindow,false ) -- makes so you cannot set the size. addEventHandler("onClientGUIClick",jobwindow, function(b) if b == "left" then if source == takebutton then if getTeamName(getPlayerTeam(lp)) ~= "Criminal" then triggerServerEvent ( "HaveCriminalJob", lp) outputChatBox ("You are now now employed as a Criminal",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) -- sets the cursor visible if getTeamName(getPlayerTeam(lp)) == "Criminal" then outputChatBox ("You already have this job..",0,255,0, true) guiSetVisible(jobwindow,false) showCursor(false) end end end) addEvent("HaveCriminalJob", true) function createHouses () x, y, z = unpackRobberHouses () robhouseMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) robhouseBlip = createBlipAttachedTo ( robhouseMarker, 32, localPlayer ) end addEventHandler ( "createHouseEvent", root, createHouses ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerEvent ( "createHouseEvent", localPlayer ) end end ) addEventHandler ( "onClientPedDamage", resourceRoot, function () cancelEvent () end ) no errors or debugscript errors, sorry for double posting.
  22. got another problem the whole job doesn't work Server function HaveCriminalJob() triggerClientEvent(source,"HaveCriminalJob",root,TheX,TheY) setPlayerTeam(source,getTeamFromName("Criminal")) end addEvent ( "HaveCriminalJob", true) addEventHandler("HaveCriminalJob", root, HaveCriminalJob) addEvent ( "givePlayerPay", true ) function givePlayerRobPay () money = math.random ( 150, 2500 ) givePlayerMoney ( source, money ) outputChatBox ( "You successfully robbed the house and made $" ..money, source ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 2500, 1, source, true, 1 ) end addEventHandler ( "givePlayerPay", root, givePlayerRobPay ) Client local robberHouses = { { 1887, -1113, 25 }; { 2092, -1160, 25 }; { 1896, -1165, 22 }; { 2068, -1720, 13 }; { 1970, -1671, 17 }; { 1895, -1071, 23 }; { 1940, -1066, 23 }; { 1955, -1074, 23 }; { 1960, -1069, 23 }; -- add whit { x,y, z}; { 1956, -1115, 26 }; { 1945, -1115, 26 }; { 1924, -1115, 26 }; { 1900, -1114, 26 }; { 2596, -1237, 47 }; { 2595, -1199, 58 }; { 2516, -1028, 69 }; { 2630, -1072, 68 }; { 2794, -1246, 45 }; { 2809, -1176, 25 }; { 2586, -953, 80 }; } function unpackRobberHouses () return unpack ( robberHouses [ math.random ( #robberHouses ) ] ) end jobmarker = createMarker( 2054.4609375, -1759.5224609375, 13.549641609192, "cylinder", 1.5, 255, 153, 0, 150 ) addEventHandler("onResourceStart",jobmarker,function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(jobmarker,true) showCursor(true) end end) sx,sy = guiGetScreenSize() -- creates a variable lp = getLocalPlayer() -- creates a variable mr = math.random(1,2) -- creates a variable jobwindow = guiCreateWindow(0.3*sx,0.3*sy,0.4*sx,0.4*sy,"Criminal",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) -- makes the gui unvisible guiMemoSetReadOnly(memo,true) -- makes so the memo text cannot be edited. guiWindowSetMovable (jobwindow,false ) -- makes to the window is not moveable guiWindowSetSizable (jobwindow,false ) -- makes so you cannot set the size. addEventHandler("onClientGUIClick",jobwindow, function(b) if b == "left" then if source == takebutton then if getTeamName(getPlayerTeam(lp)) ~= "Criminal" then triggerServerEvent ( "HaveCriminalJob", lp) outputChatBox ("You are now now employed as a Criminal",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) -- sets the cursor visible if getTeamName(getPlayerTeam(lp)) == "Criminal" then outputChatBox ("You already have this job..",0,255,0, true) guiSetVisible(jobwindow,false) showCursor(false) end end end) addEvent("HaveCriminalJob", true) function createHouses () x, y, z = unpackRobberHouses () robhouseMarker = createMarker ( x, y, z, "cylinder", 3, 255, 51, 102, 85, localPlayer ) robhouseBlip = createBlipAttachedTo ( robhouseMarker, 32, localPlayer ) end addEventHandler ( "createHouseEvent", root, createHouses ) addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( source == robhouseMarker and not isPedInVehicle ( localPlayer ) and hitElement == localPlayer ) then triggerServerEvent ( "givePlayerPay", localPlayer ) destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerEvent ( "createHouseEvent", localPlayer ) end end ) addEventHandler ( "onClientPedDamage", resourceRoot, function () cancelEvent () end ) no errors or debugscript
×
×
  • Create New...