damien111
Members-
Posts
270 -
Joined
-
Last visited
Everything posted by damien111
-
thanks andrel, we can read, no need for TALKING LIKE THIS. But Thanks Guys!
-
The route system doesnt work past the first marker. client local client = getLocalPlayer( ) local rootElement = getRootElement() local marker = nil local blip = nil addEvent("bus_set_location",true) addEventHandler("bus_set_location",rootElement, function (x, y, z) marker = createMarker(tostring(x), tostring(y), tostring(z)-1, "cylinder", 3.5, 255, 255, 0, 170) blip = createBlipAttachedTo( marker, 0, 2, 255, 255, 0, 255 ) addEventHandler("onClientMarkerHit",marker,onBusStopHit) end) function onBusStopHit(hitPlayer) if not hitPlayer == client then return end triggerServerEvent("bus_finish",client,client) if isElement(blip) then destroyElement(blip) end if isElement(marker) then removeEventHandler("onClientMarkerHit",marker,onBusStopHit) destroyElement(marker) end end addEventHandler("onClientVehicleExit",rootElement, function () if isElement(marker) then removeEventHandler("onClientMarkerHit",marker,onBusStopHit) destroyElement(marker) end if isElement(blip) then destroyElement(blip) end end) function resourceBootUp () ourPed = createPed ( 261, 1078.9228515625, 1411.5380859375, 5.8203125 ) ourBlip = createBlipAttachedTo ( ourPed, 41 ) setBlipVisibleDistance ( ourBlip, 300 ) setElementFrozen ( ourPed, true ) setElementRotation ( ourPed, 0, 0, 0 ) setElementInterior ( ourPed, 0 ) setElementDimension ( ourPed, 0 ) end addEventHandler ( "onClientResourceStart", resourceRoot, resourceBootUp ) local robberWindow = guiCreateWindow ( 0.314, 0.2513, 0.3809, 0.3893, "Bus Driver Job GUI", true ) local robberLabel = guiCreateLabel ( 0.0193, 0.0736, 0.9903, 0.1104, "Bus Driver Job.", true, robberWindow ) guiLabelSetColor ( robberLabel, 255, 0, 0 ) guiLabelSetHorizontalAlign ( robberLabel, "center", false ) guiSetFont ( robberLabel, "default-bold-small" ) local robberInfoLabel = guiCreateLabel ( 0.0309, 0.2441, 0.944, 0.3077, "Yu will have to drive marker to marker on the bus route to make money as this job.", true, robberWindow ) local robberAcceptButton = guiCreateButton ( 0.3533 ,0.7993, 0.1409, 0.1204, "Accept", true, robberWindow ) local robberCloseButton = guiCreateButton ( 0.5309, 0.7993, 0.1409, 0.1204, "Close", true, robberWindow ) guiSetVisible ( robberWindow, false ) function detectClickOnPed ( button, state, absX, absY, wx, wy, wz, element ) if ( element and element == ourPed and not isPedInVehicle ( localPlayer ) ) then local x, y, z = getElementPosition ( localPlayer ) if ( getDistanceBetweenPoints3D ( x, y, z, wx, wy, wz ) <= 3 ) then guiSetVisible ( robberWindow, true ) end end end function buttonClick ( button ) if ( button ~= "left" ) then return end if ( source == robberCloseButton ) then guiSetVisible ( robberWindow, false ) showCursor ( false ) elseif ( source == robberAcceptButton ) then triggerServerEvent ( "robberJobAccepted", localPlayer ) guiSetVisible ( robberWindow, false ) showCursor ( false ) outputChatBox ( "You are now employed as a Bus Driver!" ) end end addEventHandler ( "onClientGUIClick", resourceRoot, buttonClick ) addEventHandler ( "onClientClick", root, detectClickOnPed ) server local rootElement = getRootElement() local busses = {[431] = true } local busTable = { [1]={ 1042.3076171875, 1375.7373046875, 13.344779968262}, [2]={ 1084.0654296875, 1196.6591796875, 11.39603805542}, [3]={ 1324.9248046875, 1191.2177734375, 13.263603210449}, [4]={ 1604.5009765625, 1129.4189453125, 11.673355102539}, [5]={ 2012.2724609375, 955.734375, 10.785877227783}, [6]={ 2292.7021484375, 743.140625, 10.735727310181}, [7]={ 2665.10546875, 770.3203125, 12.419276237488}, [8]={ 2310.0361328125, 635.3916015625, 12.132932662964 }, [9]={ 2113.9609375, 675.4580078125, 12.021522521973}, [10]={ 1974.857421875, 631.505859375, 11.72947883606}, [11]={ 2112.8583984375, 753.2626953125, 15.1450128555}, [12]={ 2149.232421875, 957.4287109375, 12.598885536194}, [13]={ 2112.8583984375, 753.2626953125, 15.1450128555}, [14]={ 2607.4951171875, 1162.19921875, 14.605998039246}, [15]={ 2546.90234375, 970.396484375, 15.859393119812}, [16]={ 2429.2587890625, 1583.8203125, 14.359293937683}, [17]={ 2429.2587890625, 1583.8203125, 14.359293937683}, [18]={ 2510.798828125, 1848.0126953125, 12.436297416687}, [19]={ 2446.478515625, 2057.087890625, 1.638541221619}, [20]={ 2267.6416015625, 2416.685546875, 12.042870521545}, [21]={ 2363.0966796875, 2715.0849609375, 13.728246688843}, [22]={ 1926.2080078125, 2744.171875, 12.924875259399}, [23]={ 1447.4912109375, 2718.201171875, 12.831276893616}, [24]={ 1525.626953125, 2390.216796875, 13.046078681946}, [25]={ 1890.8935546875, 2176.982421875, 12.568361282349}, [26]={ 2150.294921875, 1993.9716796875, 13.992697715759}, [27]={ 2607.4951171875, 1162.19921875, 14.605998039246}, [28]={ 1727.5556640625, 1372.2890625, 14.906467437744}, [29]={ 1522.5419921875, 1876.37890625, 12.484322547913}, [30]={ 1336.0322265625, 2055.130859375, 12.992102622986}, [31]={ 1077.712890625, 2055.443359375, 16.641700744629}, [32]={ 1010.5498046875, 2307.3671875, 13.428218841553}, [33]={ 903.7802734375, 2350.5205078125, 15.844319343567}, [34]={ 903.83984375, 1980.5625, 12.889327049255}, [35]={ 1010.5498046875, 2307.3671875, 13.428218841553} } function createRobberTeam () robberTeam = createTeam ( "Bus Drivers", 250, 250, 0 ) end addEventHandler ( "onResourceStart", resourceRoot, createRobberTeam ) addEvent ( "robberJobAccepted", true ) function givePlayerJob ( ) setPlayerTeam ( source, robberTeam ) setElementModel ( source, 261 ) end addEventHandler ( "robberJobAccepted", root, givePlayerJob ) function getNewBusLocation(thePlayer, ID) local x, y, z = busTable[ID][1], busTable[ID][2], busTable[ID][3] triggerClientEvent(thePlayer,"bus_set_location",thePlayer,x,y,z) end function onVehicleEnter(thePlayer) if not busses[getElementModel(source)] then return end if not getPlayerTeam(thePlayer) then return end if getTeamName(getPlayerTeam(thePlayer)) == "Bus Drivers" then local x, y, z = getNewBusLocation(thePlayer, 1) setElementData(thePlayer,"busData",1) end end addEventHandler("onVehicleEnter",rootElement,onVehicleEnter) addEvent("bus_finish",true) addEventHandler("bus_finish",rootElement, function (client) if not isPedInVehicle(client) then return end if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end givePlayerMoney(client, 100) if #busTable == tonumber(getElementData(client,"busData")) then setElementData(client,"busData",1) else setElementData(client,"busData",tonumber(getElementData(client,"busData"))+1) end getNewBusLocation(client, tonumber(getElementData(client,"busData"))) end)
-
i want the server to reload and save a players money and location from when they loggedoff. any advice?
-
Hey, i was wondering how to delete parts of the world. ive seen it done in other servers, but i am greatly confused, also, in the mean time , how can i warp a players vehicle, and keep them in it? So i can have people get in and out of areas easier
-
Now i cant get it to pop up when a player dies. I used onPlayerWasted.. Server: teamFreeroamers = createTeam ( "Admins", 200, 200, 200 ) function greetPlayer ( ) triggerClientEvent ( "onGreeting", getRootElement()) showCursor ( source, true ) end addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer ) function greetingCommand ( ) -- getLocalPlayer instead of getRootElement makes the client player the 'source' on the server function, eliminating the need for an additional player argument to be transferred. end function greetingHandler ( message ) spawnPlayer (source, 2005, 1543, 13.590750694275, 0, 207, 0, 0, getTeamFromName ( "Admins" )) end addEvent( "Testers", true ) addEventHandler( "Testers", root, greetingHandler ) function bringUp ( ) triggerClientEvent( "onDeath", getRootElement()) showCursor ( source, true) end addEventHandler ( "onPlayerWasted", getRootElement(), bringUp ) CLient: GUIEditorTabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function createLoginWindow ( ) GUIEditor_Button[1] = guiCreateButton(547,87,5,5,"",false) GUIEditorTabPanel = guiCreateTabPanel(217,68,357,477,false) GUIEditor_Tab[1] = guiCreateTab("Police",GUIEditorTabPanel) SCLVSPAWN = guiCreateButton(14,81,128,40,"Police Officer - LV",false,GUIEditor_Tab[1]) GUIEditor_Button[3] = guiCreateButton(14,121,129,40,"Police Officer - SF",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(14,62,172,33,"Standard Police Officers",false,GUIEditor_Tab[1]) GUIEditor_Button[4] = guiCreateButton(442,80,5,5,"",false,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(14,165,172,33,"Police Groups/Squads",false,GUIEditor_Tab[1]) GUIEditor_Button[5] = guiCreateButton(14,185,129,40,"San Andreas State Trooper",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(175,40,164,223,"The Law Enforcment of San Andreas. They can arrest by hitting a wanted person with a nightstick.",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Civlian",GUIEditorTabPanel) GUIEditor_Button[6] = guiCreateButton(23,20,128,35,"CJ Skin (Customizable)",false,GUIEditor_Tab[2]) GUIEditor_Button[7] = guiCreateButton(23,66,128,35,"Asian",false,GUIEditor_Tab[2]) GUIEditor_Button[8] = guiCreateButton(23,115,128,35,"Black Guy",false,GUIEditor_Tab[2]) GUIEditor_Button[9] = guiCreateButton(46,134,5,5,"",false,GUIEditor_Button[8]) GUIEditor_Button[10] = guiCreateButton(23,164,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Button[11] = guiCreateButton(23,213,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(172,15,165,248,"As A Civlian You Can Get Jobs To Make Money For Cars, Drugs, Guns, Houses, and more. Please Note That The Clothes Are For The CJ Skin Only",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Gov.",GUIEditorTabPanel) GUIEditor_Button[12] = guiCreateButton(25,43,149,52,"President Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[13] = guiCreateButton(25,97,149,52,"Vice-Prez Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[14] = guiCreateButton(25,151,149,52,"Mayor",false,GUIEditor_Tab[3]) GUIEditor_Button[15] = guiCreateButton(33,120,5,5,"",false,GUIEditor_Button[14]) GUIEditor_Button[16] = guiCreateButton(25,205,149,52,"Chief of Police",false,GUIEditor_Tab[3]) GUIEditor_Button[17] = guiCreateButton(25,291,149,52,"Secret Service",false,GUIEditor_Tab[3]) GUIEditor_Button[18] = guiCreateButton(25,344,149,52,"Security Task Force",false,GUIEditor_Tab[3]) GUIEditor_Label[3] = guiCreateLabel(76,34,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[4] = guiCreateLabel(97,117,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[5] = guiCreateLabel(27,20,114,18,"Goverment Officials",false,GUIEditor_Tab[3]) GUIEditor_Label[6] = guiCreateLabel(27,271,114,18,"Govermant Security",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(182,18,164,251,"The people who run and keep San Andreas clean and safe.",false,GUIEditor_Tab[3]) GUIEditor_Memo[4] = guiCreateMemo(188,283,156,115,"The security units to protect the goverment!",false,GUIEditor_Tab[3]) guiSetVisible( GUIEditorTabPanel, true ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), createLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() addEventHandler("onClientGUIClick",SCLVSPAWN,spawnpolice1,false) end ) function onDeath ( ) guiSetVisible( GUIEditorTabPanel, false ) end addEvent( "onDeath", true ) addEventHandler( "onDeath", getRootElement(), onDeath ) function spawnpolice1 ( ) triggerServerEvent ( "Testers", localPlayer ) guiSetVisible( GUIEditorTabPanel, false ) end
-
Still Is Not Spawning The player Server teamFreeroamers = createTeam ( "Admins", 200, 200, 200 ) function greetPlayer ( ) triggerClientEvent ( "onGreeting", getRootElement()) showCursor ( source, true ) end addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer ) function greetingCommand ( ) -- getLocalPlayer instead of getRootElement makes the client player the 'source' on the server function, eliminating the need for an additional player argument to be transferred. end function greetingHandler ( message ) spawnPlayer (source, 2005, 1543, 13.590750694275, 0, 207, 0, 0, getTeamFromName ( "Admins" )) end addEvent( "Testers", true ) addEventHandler( "Testers", root, greetingHandler ) Client GUIEditorTabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function createLoginWindow ( ) GUIEditor_Button[1] = guiCreateButton(547,87,5,5,"",false) GUIEditorTabPanel = guiCreateTabPanel(217,68,357,477,false) GUIEditor_Tab[1] = guiCreateTab("Police",GUIEditorTabPanel) SCLVSPAWN = guiCreateButton(14,81,128,40,"Police Officer - LV",false,GUIEditor_Tab[1]) GUIEditor_Button[3] = guiCreateButton(14,121,129,40,"Police Officer - SF",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(14,62,172,33,"Standard Police Officers",false,GUIEditor_Tab[1]) GUIEditor_Button[4] = guiCreateButton(442,80,5,5,"",false,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(14,165,172,33,"Police Groups/Squads",false,GUIEditor_Tab[1]) GUIEditor_Button[5] = guiCreateButton(14,185,129,40,"San Andreas State Trooper",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(175,40,164,223,"The Law Enforcment of San Andreas. They can arrest by hitting a wanted person with a nightstick.",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Civlian",GUIEditorTabPanel) GUIEditor_Button[6] = guiCreateButton(23,20,128,35,"CJ Skin (Customizable)",false,GUIEditor_Tab[2]) GUIEditor_Button[7] = guiCreateButton(23,66,128,35,"Asian",false,GUIEditor_Tab[2]) GUIEditor_Button[8] = guiCreateButton(23,115,128,35,"Black Guy",false,GUIEditor_Tab[2]) GUIEditor_Button[9] = guiCreateButton(46,134,5,5,"",false,GUIEditor_Button[8]) GUIEditor_Button[10] = guiCreateButton(23,164,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Button[11] = guiCreateButton(23,213,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(172,15,165,248,"As A Civlian You Can Get Jobs To Make Money For Cars, Drugs, Guns, Houses, and more. Please Note That The Clothes Are For The CJ Skin Only",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Gov.",GUIEditorTabPanel) GUIEditor_Button[12] = guiCreateButton(25,43,149,52,"President Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[13] = guiCreateButton(25,97,149,52,"Vice-Prez Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[14] = guiCreateButton(25,151,149,52,"Mayor",false,GUIEditor_Tab[3]) GUIEditor_Button[15] = guiCreateButton(33,120,5,5,"",false,GUIEditor_Button[14]) GUIEditor_Button[16] = guiCreateButton(25,205,149,52,"Chief of Police",false,GUIEditor_Tab[3]) GUIEditor_Button[17] = guiCreateButton(25,291,149,52,"Secret Service",false,GUIEditor_Tab[3]) GUIEditor_Button[18] = guiCreateButton(25,344,149,52,"Security Task Force",false,GUIEditor_Tab[3]) GUIEditor_Label[3] = guiCreateLabel(76,34,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[4] = guiCreateLabel(97,117,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[5] = guiCreateLabel(27,20,114,18,"Goverment Officials",false,GUIEditor_Tab[3]) GUIEditor_Label[6] = guiCreateLabel(27,271,114,18,"Govermant Security",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(182,18,164,251,"The people who run and keep San Andreas clean and safe.",false,GUIEditor_Tab[3]) GUIEditor_Memo[4] = guiCreateMemo(188,283,156,115,"The security units to protect the goverment!",false,GUIEditor_Tab[3]) guiSetVisible( GUIEditorTabPanel, true ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), createLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() addEventHandler("onClientGUIClick",SCLVSPAWN,spawnpolice1,false) end ) function spawnpolice1 ( ) triggerServerEvent ( "Testers", localPlayer ) end [/lua]
-
Nothing! I Click The Button and it just, does nothing. You want to check it out on my server? Or. What.
-
It isnt doing what it suppuse to do. I need it to spawn the player >< But i cant get it to do that..
-
WARNING: TestPanel24\Client.lua:52:Bad Argument@ AddEventHandler [ Expected Elment at Argument2,gotnil.]
-
Still will not let me spawn: Server teamFreeroamers = createTeam ( "Admins", 200, 200, 200 ) function greetPlayer ( ) triggerClientEvent ( "onGreeting", getRootElement()) showCursor ( source, true ) end addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer ) function greetingCommand ( ) -- getLocalPlayer instead of getRootElement makes the client player the 'source' on the server function, eliminating the need for an additional player argument to be transferred. end function greetingHandler ( message ) spawnPlayer (source, 2005, 1543, 13.590750694275, 0, 207, 0, 0, getTeamFromName ( "Admins" )) end addEvent( "Testers", true ) addEventHandler( "Testers", source(), greetingHandler ) Client GUIEditorTabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function createLoginWindow ( ) GUIEditor_Button[1] = guiCreateButton(547,87,5,5,"",false) GUIEditorTabPanel = guiCreateTabPanel(217,68,357,477,false) GUIEditor_Tab[1] = guiCreateTab("Police",GUIEditorTabPanel) SCLVSPAWN = guiCreateButton(14,81,128,40,"Police Officer - LV",false,GUIEditor_Tab[1]) GUIEditor_Button[3] = guiCreateButton(14,121,129,40,"Police Officer - SF",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(14,62,172,33,"Standard Police Officers",false,GUIEditor_Tab[1]) GUIEditor_Button[4] = guiCreateButton(442,80,5,5,"",false,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(14,165,172,33,"Police Groups/Squads",false,GUIEditor_Tab[1]) GUIEditor_Button[5] = guiCreateButton(14,185,129,40,"San Andreas State Trooper",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(175,40,164,223,"The Law Enforcment of San Andreas. They can arrest by hitting a wanted person with a nightstick.",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Civlian",GUIEditorTabPanel) GUIEditor_Button[6] = guiCreateButton(23,20,128,35,"CJ Skin (Customizable)",false,GUIEditor_Tab[2]) GUIEditor_Button[7] = guiCreateButton(23,66,128,35,"Asian",false,GUIEditor_Tab[2]) GUIEditor_Button[8] = guiCreateButton(23,115,128,35,"Black Guy",false,GUIEditor_Tab[2]) GUIEditor_Button[9] = guiCreateButton(46,134,5,5,"",false,GUIEditor_Button[8]) GUIEditor_Button[10] = guiCreateButton(23,164,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Button[11] = guiCreateButton(23,213,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(172,15,165,248,"As A Civlian You Can Get Jobs To Make Money For Cars, Drugs, Guns, Houses, and more. Please Note That The Clothes Are For The CJ Skin Only",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Gov.",GUIEditorTabPanel) GUIEditor_Button[12] = guiCreateButton(25,43,149,52,"President Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[13] = guiCreateButton(25,97,149,52,"Vice-Prez Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[14] = guiCreateButton(25,151,149,52,"Mayor",false,GUIEditor_Tab[3]) GUIEditor_Button[15] = guiCreateButton(33,120,5,5,"",false,GUIEditor_Button[14]) GUIEditor_Button[16] = guiCreateButton(25,205,149,52,"Chief of Police",false,GUIEditor_Tab[3]) GUIEditor_Button[17] = guiCreateButton(25,291,149,52,"Secret Service",false,GUIEditor_Tab[3]) GUIEditor_Button[18] = guiCreateButton(25,344,149,52,"Security Task Force",false,GUIEditor_Tab[3]) GUIEditor_Label[3] = guiCreateLabel(76,34,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[4] = guiCreateLabel(97,117,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[5] = guiCreateLabel(27,20,114,18,"Goverment Officials",false,GUIEditor_Tab[3]) GUIEditor_Label[6] = guiCreateLabel(27,271,114,18,"Govermant Security",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(182,18,164,251,"The people who run and keep San Andreas clean and safe.",false,GUIEditor_Tab[3]) GUIEditor_Memo[4] = guiCreateMemo(188,283,156,115,"The security units to protect the goverment!",false,GUIEditor_Tab[3]) guiSetVisible( GUIEditorTabPanel, true ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), createLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() end ) function spawnpolice1 ( ) triggerServerEvent ( "Testers", localPlayer ) end addEventHandler("onClientGUIClick",SCLVSPAWN,spawnpolice1,false)
-
Ok i did everything but the team thing. I do not understand what you mean
-
Hello. I am VERY new to gui coding and i am trying to make a cheap,shitty, refrence spawn menu script. Can you help me out with why its not spawning the player when he presses button client GUIEditorTabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function createLoginWindow ( ) GUIEditor_Button[1] = guiCreateButton(547,87,5,5,"",false) GUIEditorTabPanel = guiCreateTabPanel(217,68,357,477,false) GUIEditor_Tab[1] = guiCreateTab("Police",GUIEditorTabPanel) SCLVSPAWN = guiCreateButton(14,81,128,40,"Police Officer - LV",false,GUIEditor_Tab[1]) GUIEditor_Button[3] = guiCreateButton(14,121,129,40,"Police Officer - SF",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(14,62,172,33,"Standard Police Officers",false,GUIEditor_Tab[1]) GUIEditor_Button[4] = guiCreateButton(442,80,5,5,"",false,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(14,165,172,33,"Police Groups/Squads",false,GUIEditor_Tab[1]) GUIEditor_Button[5] = guiCreateButton(14,185,129,40,"San Andreas State Trooper",false,GUIEditor_Tab[1]) GUIEditor_Memo[1] = guiCreateMemo(175,40,164,223,"The Law Enforcment of San Andreas. They can arrest by hitting a wanted person with a nightstick.",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Civlian",GUIEditorTabPanel) GUIEditor_Button[6] = guiCreateButton(23,20,128,35,"CJ Skin (Customizable)",false,GUIEditor_Tab[2]) GUIEditor_Button[7] = guiCreateButton(23,66,128,35,"Asian",false,GUIEditor_Tab[2]) GUIEditor_Button[8] = guiCreateButton(23,115,128,35,"Black Guy",false,GUIEditor_Tab[2]) GUIEditor_Button[9] = guiCreateButton(46,134,5,5,"",false,GUIEditor_Button[8]) GUIEditor_Button[10] = guiCreateButton(23,164,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Button[11] = guiCreateButton(23,213,128,35,"Mexican",false,GUIEditor_Tab[2]) GUIEditor_Memo[2] = guiCreateMemo(172,15,165,248,"As A Civlian You Can Get Jobs To Make Money For Cars, Drugs, Guns, Houses, and more. Please Note That The Clothes Are For The CJ Skin Only",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Gov.",GUIEditorTabPanel) GUIEditor_Button[12] = guiCreateButton(25,43,149,52,"President Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[13] = guiCreateButton(25,97,149,52,"Vice-Prez Of San Andreas",false,GUIEditor_Tab[3]) GUIEditor_Button[14] = guiCreateButton(25,151,149,52,"Mayor",false,GUIEditor_Tab[3]) GUIEditor_Button[15] = guiCreateButton(33,120,5,5,"",false,GUIEditor_Button[14]) GUIEditor_Button[16] = guiCreateButton(25,205,149,52,"Chief of Police",false,GUIEditor_Tab[3]) GUIEditor_Button[17] = guiCreateButton(25,291,149,52,"Secret Service",false,GUIEditor_Tab[3]) GUIEditor_Button[18] = guiCreateButton(25,344,149,52,"Security Task Force",false,GUIEditor_Tab[3]) GUIEditor_Label[3] = guiCreateLabel(76,34,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[4] = guiCreateLabel(97,117,5,5,"",false,GUIEditor_Tab[3]) GUIEditor_Label[5] = guiCreateLabel(27,20,114,18,"Goverment Officials",false,GUIEditor_Tab[3]) GUIEditor_Label[6] = guiCreateLabel(27,271,114,18,"Govermant Security",false,GUIEditor_Tab[3]) GUIEditor_Memo[3] = guiCreateMemo(182,18,164,251,"The people who run and keep San Andreas clean and safe.",false,GUIEditor_Tab[3]) GUIEditor_Memo[4] = guiCreateMemo(188,283,156,115,"The security units to protect the goverment!",false,GUIEditor_Tab[3]) guiSetVisible( GUIEditorTabPanel, true ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), createLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() end ) function spawnpolice1 ( ) triggerServerEvent ( "Testers", source ) end addEventHandler("onClientGUIClick",SCLVSPAWN,spawnpolice1,false) server teamFreeroamers = createTeam ( "Admins", 200, 200, 200 ) function greetPlayer ( ) triggerClientEvent ( "onGreeting", getRootElement()) showCursor ( source, true ) end addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer ) function greetingCommand ( ) -- getLocalPlayer instead of getRootElement makes the client player the 'source' on the server function, eliminating the need for an additional player argument to be transferred. end function greetingHandler ( message ) spawnPlayer (source, 2005, 1543, 13.590750694275, 0, 207, 0, 0, "Admins") end addEvent( "Testers", true ) addEventHandler( "Testers", source(), greetingHandler ) "Damien" name="sccript" version="1.0" type="script"/>
-
Ok the firt thing, i was trying to make it so the Edit = a Variable, then made the getPlayerName get it from that. so it will place a blip on them. and 2.idk what line of code
-
i still need help with why nobody can enter a car unless its scripted to thier team. Like its locked to the team. Its really annoying
-
i didnt notice i put that line of code in there
-
I cant get this script to work here is the debugscript 3 error ERROR: carjacker5\robber_client.lua:9 attempt to call global 'creatETeam' (a nil value) heree is the code CLIENT theMarker = createMarker(1728.0740966797, 2010.6652832031, 10, "cylinder", 4, 255, 0, 0, 255) theTeam = createTeam("Car Jackers", 255, 0, 0) local coordinates = { {1509.0999755859, 2111.6999511719, 12, 0, 0, 90}, {1509, 2118.1999511719, 12, 0, 0, 90}, {1613.5999755859, 2217.1000976563, 12, 0, 0, 90}, {2103.1999511719, 2046.1999511719, 12, 0, 0, 90}, {2185.6000976563, 1996.3000488281, 12, 0, 0, 90}, {2458.5, 1346.4000244141, 10.800000190735, 0, 0, 0}, {2441.3999023438, 1345.8000488281, 12, 0, 0, 270}, {2142.3999023438, 1015.9000244141, 12, 0, 0, 270}, {1709.4000244141, 1168, 34.799999237061, 0, 0, 0}, {1878.5999755859, 1815.6999511719, 13, 0, 0, 0}, {2015.5999755859, 2165.6000976563, 12, 0, 0, 0}, {2077.5, 2410.8000488281, 46, 0, 0, 90}, {2584.1999511719, 2250.6000976563, 12, 0, 0, 0}, {2631.1999511719, 1687.6999511719, 12, 0, 0, 90}, } local IDS = { { 402 }, { 542 }, { 603 }, { 475 }, { 576 }, { 575 }, { 567 } } function getRandomCoordinates() return unpack(coordinates[math.random(#coordinates)]) end function getRandomCoordinates1() return unpack(IDS[math.random(#IDS)]) end veh = {} function resourceBootUp () ourPed = createPed ( 293, 1734.7218017578, 1993.3072509766, 10 ) ourBlip = createBlipAttachedTo ( ourPed, 41 ) setBlipVisibleDistance ( ourBlip, 300 ) setElementFrozen ( ourPed, true ) setElementRotation ( ourPed, 0, 0, 0 ) setElementInterior ( ourPed, 0 ) setElementDimension ( ourPed, 0 ) end addEventHandler ( "onClientResourceStart", resourceRoot, resourceBootUp ) local robberWindow = guiCreateWindow ( 0.314, 0.2513, 0.3809, 0.3893, "Car Jacker Job GUI", true ) local robberLabel = guiCreateLabel ( 0.0193, 0.0736, 0.9903, 0.1104, "Car Jacker Job.", true, robberWindow ) guiLabelSetColor ( robberLabel, 255, 0, 0 ) guiLabelSetHorizontalAlign ( robberLabel, "center", false ) guiSetFont ( robberLabel, "default-bold-small" ) local robberInfoLabel = guiCreateLabel ( 0.0309, 0.2441, 0.944, 0.3077, "If you accept this job, you are able to sell certain cars that\nyou steal, the car you have to steal is\n marked with a car blip on your map, goodluck.", true, robberWindow ) local robberAcceptButton = guiCreateButton ( 0.3533 ,0.7993, 0.1409, 0.1204, "Accept", true, robberWindow ) local robberCloseButton = guiCreateButton ( 0.5309, 0.7993, 0.1409, 0.1204, "Close", true, robberWindow ) guiSetVisible ( robberWindow, false ) function detectClickOnPed ( button, state, absX, absY, wx, wy, wz, element ) if ( element and element == ourPed and not isPedInVehicle ( localPlayer ) ) then local x, y, z = getElementPosition ( localPlayer ) if ( getDistanceBetweenPoints3D ( x, y, z, wx, wy, wz ) <= 3 ) then guiSetVisible ( robberWindow, true ) end end end addEventHandler ( "onClientClick", root, detectClickOnPed ) function buttonClick ( button ) if ( button ~= "left" ) then return end if ( source == robberCloseButton ) then guiSetVisible ( robberWindow, false ) showCursor ( false ) elseif ( source == robberAcceptButton ) then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) triggerServerEvent ( "robberJobAccepted", localPlayer ) guiSetVisible ( robberWindow, false ) showCursor ( false ) end end addEventHandler ( "onClientGUIClick", resourceRoot, buttonClick ) function startBlip ( ) myBlip = createBlipAttachedTo ( veh[source], 55, 65535, source ) end addEvent("newBlip", true) addEventHandler("newBlip",root,joinMedic) function killBlip ( ) destroyElement ( myBlip ) end addEvent("killBlip", true) addEventHandler("killBlip",root,joinMedic) server --[[ Developer: Sebastian 'seb' Cronberg Rights: All rights reserved by the developer (c) 2012 File: ronbber_server.lua ]] function createRobberTeam () robberTeam = createTeam ( "Car Jackers" ) end addEventHandler ( "onResourceStart", resourceRoot, createRobberTeam ) addEvent ( "robberJobAccepted", true ) function givePlayerJob ( ) setPlayerTeam ( source, robberTeam ) setElementModel ( source, 28 ) x, y, z, rx, ry, rz = getRandomCoordinates() ID = getRandomCoordinates1() if isElement(veh[source]) then destroyElement(veh[source]) veh[source] = nil end veh[source] = createVehicle(ID, x, y, z, rx, ry, rz ) triggerClientEvent ( "newBlip", localPlayer ) end addEventHandler ( "robberJobAccepted", root, givePlayerJob ) theMarker = createMarker(1728.0740966797, 2010.6652832031, 10, "cylinder", 4, 255, 0, 0, 255) theTeam = createTeam("Car Jackers", 255, 0, 0) local coordinates = { {1509.0999755859, 2111.6999511719, 12, 0, 0, 90}, {1509, 2118.1999511719, 12, 0, 0, 90}, {1613.5999755859, 2217.1000976563, 12, 0, 0, 90}, {2103.1999511719, 2046.1999511719, 12, 0, 0, 90}, {2185.6000976563, 1996.3000488281, 12, 0, 0, 90}, {2458.5, 1346.4000244141, 10.800000190735, 0, 0, 0}, {2441.3999023438, 1345.8000488281, 12, 0, 0, 270}, {2142.3999023438, 1015.9000244141, 12, 0, 0, 270}, {1709.4000244141, 1168, 34.799999237061, 0, 0, 0}, {1878.5999755859, 1815.6999511719, 13, 0, 0, 0}, {2015.5999755859, 2165.6000976563, 12, 0, 0, 0}, {2077.5, 2410.8000488281, 46, 0, 0, 90}, {2584.1999511719, 2250.6000976563, 12, 0, 0, 0}, {2631.1999511719, 1687.6999511719, 12, 0, 0, 90}, } local IDS = { { 402 }, { 542 }, { 603 }, { 475 }, { 576 }, { 575 }, { 567 } } function getRandomCoordinates() return unpack(coordinates[math.random(#coordinates)]) end function getRandomCoordinates1() return unpack(IDS[math.random(#IDS)]) end veh = {} function spawnveh(player) if (getElementType(player) == "player") then theVehicle = getPedOccupiedVehicle(player) if (theVehicle and theVehicle == veh[player]) then destroyElement (veh[player]) veh[player] = nil givePlayerMoney(player, 10000) outputChatBox("You have sold your stolen car",player,0,255,0) triggerClientEvent ( "killBlip", localPlayer ) else outputChatBox("You do not have the Vehicle!", player,255,0,0,true) end end end addEventHandler("onMarkerHit", theMarker, spawnveh) function destroyCar() for i, player in ipairs (getElementsByType("player")) do if veh[player] == source then veh[player] = nil destroyElement ( myBlip) end end setTimer(destroyElement,3500,1,source) end addEventHandler("onVehicleExplode", root, destroyCar) addEventHandler("onPlayerQuit",root, function() if isElement(veh[source]) then destroyElement(veh[source]) veh[source] = nil destroyElement( myBlip ) end end) please help Also ever since i locked vehicles teams can get in any car unless it is scripted to there team
-
how to set blip client side attached to something serverside?
-
Okay, its not giving the money, taking the car, or setting the team. Also, it opens the panel for everyone on the server. can you help more?
-
Btw, im sorry, didnt mean to be mean or anger you or anything
-
I did not say what you quoted, im just saying, it seemed that you did not know what your doing, due to the fact you posted someone elses script , i was just saying, -.- no need to get all angry I DID NOT SAY "U DUMB, LEARN SOME LUA AND GTFO". So dont put words in my mouth.
-
Thanks! Theres 1 more thing! when i said i wanted to lock the car. i wanted to lock it to the player who spawned it and i need help restricting the spawn so it spawns only 1 per player and knows who spawned it so they can take it to the marker for the money , also here is my code so far, i cant get it to detect the car as theCar function sellCar ( ) givePlayerMoney ( 10000 ) outputChatBox ( "You have sold your stolen car" ) end addEvent("sellcar", true) addEventHandler("sellcar",root,sellCar) function dontHave ( ) outputChatBox ( "You do not have the Vehicle!", thePlayer, 255, 0, 0, true ) end addEvent("donthave", true) addEventHandler("donthave",root,dontHave) --JOB local marker = createMarker( 1734.7218017578, 1993.3072509766, 9, "Cylinder", 2, 6, 183, 248, 153) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} windowjob = guiCreateWindow(1031,232,301,397,"Car Jacker job",false) guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,352,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,352,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,215,"To take Car Jacker team job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) function Medicjob(hitElement) if getElementType(hitElement) == "player" then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, Medicjob) function Medicjobleave(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, Medicjobleave) function joinTeam() triggerServerEvent("setMedic",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeMedicWindow, false) theMarker = createMarker ( 1728.0740966797, 2010.6652832031, 9, "cylinder", 2, 255, 255, 0, 170 ) function spawnveh ( hitElement, matchingDimension ) local elementType = getElementType ( hitElement ) if ( elementType == "player" ) then theVehicle = getPedOccupiedVehicle ( thePlayer ) if ( theVehicle == theCar ) then destroyElement ( theCar ) triggerClientEvent(hitElement, "sellcar", hitElement) givePlayerMoney ( source, 10000 ) else triggerClientEvent (hitElement, "donthave", hitElement ) end end end addEventHandler ( "onMarkerHit", theMarker, spawnveh ) --job local coordinates = { { 1725.9757080078, 1946.7092285156, 10, 0, 0, 0 }, { 1747.3811035156, 1980.2396240234, 10, 0, 0, 0 } } function getRandomCoordinates ( ) return unpack ( coordinates [ math.random ( #coordinates ) ] ) end local IDS = { { 402 }, { 542 }, { 603 }, { 475 }, { 576 }, { 575 }, { 567 } } function getRandomCoordinates1 ( ) return unpack ( IDS [ math.random ( #IDS ) ] ) end function destroyCar ( ) destroyElement( theCar ) end addEventHandler ( "onVehicleExplode", vagosVehicle, destroyCar ) function createMedicTeam () theTeam = createTeam ( "Car Jackers" ) end function joinMedic() setPlayerTeam ( source, theTeam ) setElementModel(source,293) setElementData( source, "Occupation", "Car Jacker", true ) outputChatBox("You are now Car Jacker.",source,0,255,0) x, y, z, rx, ry, rz = getRandomCoordinates ( ) ID = getRandomCoordinates1 ( ) theCar = createVehicle ( ID, x, y, z, rx, ry, rz ) end addEventHandler ( "onVehicleExplode", theCar, destroyCar ) addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic)
-
I didnt know what it would do and it doesnt give the money still so ( And yes i change it to server side )