-
Posts
525 -
Joined
-
Last visited
-
Days Won
3
Everything posted by justn
-
WARNING: carspawner\gui.lua:31: Bad argument @ 'guiGridListSetItemText' [Expected bool at argument 5, got string 'Pony'] cars = { {419}, {413} --{carID}, } local l, w = guiGetScreenSize() CarSpawner_Window = guiCreateWindow(292, 255, 391, 281, "*CIR* - Car Spawner", false) guiWindowSetSizable(CarSpawner_Window, false) guiSetAlpha(CarSpawner_Window, 1.00) guiSetVisible(CarSpawner_Window,false) CarSpawner_Label = guiCreateLabel(10, 25, 142, 15, "Select a vehicle", false, CarSpawner_Window) guiSetFont(CarSpawner_Label, "default-bold-small") CarSpawner_Gridlist = guiCreateGridList(10, 45, 371, 185, false, CarSpawner_Window) guiGridListAddColumn(CarSpawner_Gridlist, "#", 0.5) guiGridListAddColumn(CarSpawner_Gridlist, "Vehicle Name:", 0.5) guiGridListAddRow(CarSpawner_Gridlist) guiGridListSetItemText(CarSpawner_Gridlist, 0, 1, "-", false, false) guiGridListSetItemText(CarSpawner_Gridlist, 0, 2, "-", false, false) CarSpawner_Spawn = guiCreateButton(37, 240, 146, 31, "Spawn", false, CarSpawner_Window) guiSetProperty(CarSpawner_Spawn, "NormalTextColour", "FFAAAAAA") CarSpawner_Close = guiCreateButton(224, 240, 134, 31, "Close", false, CarSpawner_Window) guiSetProperty(CarSpawner_Close, "NormalTextColour", "FFAAAAAA") for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow(CarSpawner_Gridlist) guiGridListSetItemText(CarSpawner_Gridlist, row, 0, 1, "-", false, true) guiGridListSetItemText(CarSpawner_Gridlist, row, 0, 2, carName, false, true) end
-
What ? I doubt anyone would give you a perfect gamemode with all those features for free.
-
Actually, this was just an example to show you guys what I wanted. but nvm, i fixed it, thanks though
-
Okay , so if the player is new, he will spawn at the XYZ position below. that works but the problem is, so what im trying to do below is when the player quits, i want it to get the player's last position, and when the player logs in again, he will spawn at the last position he was before he had quit the server. function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source, 'playerAcc' ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playerXYZ = getElementPosition ( source ) setAccountData ( playeraccount, "playerPosition", playerXYZ ) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) function onLogin (old, acc) local firstTime = getAccountData(acc, 'firstTime') if (not firstTime) then setPlayerTeam ( source, Unemployed ) spawnPlayer(source, 1643.40002, -2249.10009, 13.300, 178.0004, 0, 0, 0, Unemployed) fadeCamera(source, true) setCameraTarget(source, source) setAccountData(acc, 'firstTime', 'true') else if (playeraccount) then if (firstTime) then local playerXYZ = getAccountData ( playeraccount, "playerPosition" ) if ( playerXYZ ) then setElementPosition ( source, playerXYZ ) end end end end end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), onLogin ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onLogin )
-
Learn to wait patiently for others to help you. Features_c.lua addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ), function() featuresWindow = guiCreateWindow(976, 290, 294, 429, "Vehicle Features", false) guiWindowSetSizable(featuresWindow, false) guiSetAlpha(featuresWindow, 0.95) chosenLabel = guiCreateLabel(10, 32, 204, 15, "No Vehicles Selected", false, featuresWindow) guiLabelSetColor(chosenLabel, 76, 116, 228) featuresGrid = guiCreateGridList(10, 116, 273, 238, false, featuresWindow) vehicleColumnGrid = guiGridListAddColumn(featuresGrid, "Vehicle", 0.5) healthColumnGrid = guiGridListAddColumn(featuresGrid, "Health", 0.5) recoverButton = guiCreateButton(9, 78, 59, 32, "Recover", false, featuresWindow) lockButton = guiCreateButton(224, 78, 59, 32, "Un/Lock", false, featuresWindow) blipButton = guiCreateButton(159, 78, 59, 32, "Un/Blip", false, featuresWindow) pickButton = guiCreateButton(9, 364, 50, 34, "Pick", false, featuresWindow) sellButton = guiCreateButton(69, 364, 50, 34, "Sell", false, featuresWindow) hideButton = guiCreateButton(129, 364, 50, 34, "Hide", false, featuresWindow) closeButton = guiCreateButton(210, 364, 73, 38, "Close", false, featuresWindow) addEventHandler ( "onClientGUIClick", pickButton, spawnVehicle, false ); addEventHandler ( "onClientGUIClick", blipButton, markVehicle, false ); addEventHandler ( "onClientGUIClick", closeButton, closeMenu, false ); guiSetVisible ( featuresMain, false ) end ) Change guiSetVisible ( featuresMain, false ) to guiSetVisible ( featuresWindow, false ) and in client.lua change this: shopWindow = guiCreateWindow(30, 352, 333, 650, "Vehicle Sales", false) guiWindowSetSizable(shopWindow, false) shopGrid = guiCreateGridList(10, 62, 312, 542, false, shopWindow) vehicleGrid = guiGridListAddColumn(shopGrid, "Vehicle", 0.5) priceGrid = guiGridListAddColumn(shopGrid, "Price", 0.5) chooseLabel = guiCreateLabel(12, 24, 181, 15, "Choose one vehicle and click Buy", false, shopWindow) guiLabelSetColor(chooseLabel, 84, 238, 16) buyButton = guiCreateButton(12, 610, 98, 29, "Buy", false, shopWindow) colorButton = guiCreateButton(115, 610, 98, 29, "Choose Color", false, shopWindow) closeButton = guiCreateButton(218, 610, 98, 29, "Close", false, shopWindow) to this: shopWindow = guiCreateWindow(30, 352, 333, 650, "Vehicle Sales", false) guiWindowSetSizable(shopWindow, false) shopGrid = guiCreateGridList(10, 62, 312, 542, false, shopWindow) vehicleGrid = guiGridListAddColumn(shopGrid, "Vehicle", 0.5) priceGrid = guiGridListAddColumn(shopGrid, "Price", 0.5) chooseLabel = guiCreateLabel(12, 24, 181, 15, "Choose one vehicle and click Buy", false, shopWindow) guiLabelSetColor(chooseLabel, 84, 238, 16) buyButton = guiCreateButton(12, 610, 98, 29, "Buy", false, shopWindow) colorButton = guiCreateButton(115, 610, 98, 29, "Choose Color", false, shopWindow) closeButton = guiCreateButton(218, 610, 98, 29, "Close", false, shopWindow) guiSetVisible ( shopWindow, false )
-
So, I would like it, so if the player has joined the server and logged in for the first time, then he will be spawned at the position below function assigntheteam () setPlayerTeam ( source, Unemployed ) spawnPlayer(source, 1643.40002, -2249.10009, 13.300, 178.0004, 0, 0, 0, Unemployed) fadeCamera(source, true) setCameraTarget(source, source) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam ) otherwise, if he has joined the server before. then, his 'Skin,Team,Money,Position' will save.
-
Works now ! Thanks to all of you !
-
Well, it spawns, but the map doesnt appear
-
Okay, so the problem is, when the player clicks the login button, and the player spawns, the screen shows only black, I want it so when the player clicks the 'Login' button and the player spawns, the camera will be on the player like normal. main_s.lua function assigntheteam () setPlayerTeam ( source, Unemployed ) thePlayer = spawnPlayer ( source, 1643.4000244141, -2249.1000976563, 13.300000190735, 0, 0, 178.000488, 0, 0, 0, Unemployed) end addEvent ( "IfNewPlayerJoin", true ) addEventHandler ( "IfNewPlayerJoin", getRootElement(), assigntheteam ) main_c.lua addEventHandler("onClientGUIClick",RegisterLogin_Window, function(b) if b == "left" then if source == LoginButton then username = guiGetText(LoginUsername) password = guiGetText(LoginPass) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password) triggerServerEvent("IfNewPlayerJoin",getLocalPlayer()) xmlFileHandler() end end end)
-
So the problem is, when the player clicks the button in the main_c.lua and if the player logged in successfully then the gui 'RegisterLogin_Window' will be closed and the cursor will be gone too main_s.lua: function loginPlayer(username,password) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn (source, account, password) exports["TopBarChat"]:sendClientMessage ("#0000FF* #FFFFFFYou have sucessfully logged in!",source,255,255,255,true) else exports["TopBarChat"]:sendClientMessage ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) end end end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),loginPlayer) main_c.lua addEventHandler("onClientGUIClick",RegisterLogin_Window, function(b) if b == "left" then if source == LoginButton then username = guiGetText(LoginUsername) password = guiGetText(LoginPass) triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password) xmlFileHandler() end end end)
-
Nice track ! Some of the deco could be better though.
-
Oh...I understand now, thanks, I fixed the problem
-
When the player clicks the button, the money does not reduce. ERROR: Airport_Transportation\client.lua:73: Bad Argument @ 'takePlayerMoney' [Expected number at argument 1, got player] addEventHandler ( "onClientGUIClick", AirportWindow, function ( b ) if isElementWithinMarker ( localPlayer, LasVenturasMarker ) then if ( b == "left" ) then if ( source == LosSantos ) then local money = getPlayerMoney(localPlayer) if (money > 499) then setElementPosition(localPlayer, 1642.41553, -2241.73169, 13.49343) guiSetVisible(AirportWindow,false) showCursor(false) takePlayerMoney ( localPlayer, 500 ) else outputChatBox("You must have at least $500 to go to Los Santos !", localPlayer, 255, 0, 0) end end end end end)
-
Can you please use /debugscript 3 and then say whats the problem?
-
Awesome Trailer !
-
http://lmgtfy.com/?q=Free+VPS
-
Thanks @SolidSnake14 & @WASSIm. Guess I learn't something new today
-
So yeah, the problem is, when the player hits 'LosSantosMarker' and clicks the button 'LosSantos' , when he hits the marker the first time, it outputs it in the chat once, but when he goes into the marker again and clicks the button again, it outputs it twice, and so on, can I have a little help please? thanks addEventHandler("onClientMarkerHit",LosSantosMarker, function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(AirportWindow, true) showCursor(true) end addEventHandler("onClientGUIClick",AirportWindow, function (b,thePlayer) if b == "left" then if source == LosSantos then cancelEvent() outputChatBox("You are already in Los Santos!", thePlayer, 255, 0, 0) end end end) end)
-
Help please? :3
-
Okay, can anyone help me with adding more locations for marker1 and getCar ? ^.^ Code: addEventHandler ( "onResourceStart", getRootElement(), function ( started ) getCar = createVehicle ( 411, 2062.91138, -1570.18054, 12.95983, 0, 0, 272 ) startBlip = createBlipAttachedTo ( getCar, 12 ) Marker1 = createMarker ( 2062.82886, -1568.31702, 12.43865, "cylinder", 2, 0, 0, 255, 85 ) setVehicleLocked ( getCar, true ) setElementFrozen ( getCar, true ) setVehicleDamageProof ( getCar, true ) exports["TopBarChat"]:sendClientMessage ("Car Jacker: Go get the car at the 'C' blip on the radar",root,0,0,255,true) end )