
CodX
Members-
Posts
71 -
Joined
-
Last visited
Everything posted by CodX
-
Isn;t good. I want to play the video in background.
-
Hello ! It's posible to place a mp4 media file onto account-system, like a trailer, to replace the image ? If yes, can you help me to make that script ?
-
Now, i've see that I.ve set fade to 0.8. Thanks you again for help !
-
local deathSound = nil local ckSound = nil function playerWasted (thePlayer) fadeCamera ( false, 10, 255, 0, 0 ) setTimer ( function() fadeCamera ( true, 1 ) end, 10000, 1 ) deathSound = playSound("deathFX/wasted.mp3",false) setSoundVolume(deathSound, 50) setGameSpeed (0.1) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), playerWasted ) function playerSpawn() if deathSound and isElement(deathSound) then destroyElement(deathSound) end setGameSpeed (1) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), playerSpawn ) local gui = {} function showCkWindow() triggerServerEvent("updateCharacters", localPlayer) setTimer(function() triggerEvent("accounts:logout", localPlayer) setGameSpeed (1) closeCkWindow() ckSound = playSound("deathFX/cked.mp3",false) setSoundVolume(ckSound, 0.4) triggerEvent("es-system:closeRespawnButton", localPlayer) gui.window = guiCreateStaticImage(0, 0, 350, 300, ":resources/window_body.png", false) exports.global:centerWindow(gui.window) gui.label = guiCreateLabel(0.05, 0.05, 0.9, 0.7, string.gsub(getPlayerName(localPlayer), "_", " ").." a primit CK!\n\nCK (Character Kill) este modul cel mai neobișnuit prin care un caracter este ucis și este folosit doar în situații în care este strict necesar. \n\nCând ești ucis prin această modalitate (CK), este permanent și singura metodă de a primi bunurile caracterului este de a crea un alt caracter care este rudă cu vechiul caracter (același nume de familie) și este anunțat un administrator pentru primirea bunurilor (character transfer).\n\nAcum vei fii redirecționat la panoul de selectare a caracterelor deoarece este singura opțiune care o mai ai.", true, gui.window) guiLabelSetHorizontalAlign(gui.label, "left", true) guiLabelSetVerticalAlign(gui.label, "center", true) gui.bClose = guiCreateButton(0.05, 0.8, 0.9, 0.15, "OK", true, gui.window) addEventHandler("onClientGUIClick", gui.bClose, function () if source == gui.bClose then closeCkWindow() end end, false) end, 2000, 1) end addEvent("showCkWindow", true) addEventHandler ( "showCkWindow", localPlayer, showCkWindow ) function closeCkWindow() if gui.window and isElement(gui.window) then destroyElement(gui.window) end end Wait, it work ! I;ve set game speed and now is good. The color wasn't placed because the game speed was to slow. P.S: Sorry for my english if isn't correctly. Thanks you for help ! #Like
-
Doesn't work.. The backround is the same.
-
I've put that in script but didn't work. function playerWasted (thePlayer) deathSound = playSound("deathFX/wasted.mp3",false) setSoundVolume(deathSound, 50) setGameSpeed (0.1) setTimer ( function() fadeCamera ( thePlayer, true, 1.0, 224, 224, 224 ) end, 10000, 1 ) end On fadeCamer he give me warning when the player was respawn who says "got boolean".
-
Hello ! It's posibble to set backrounds gray when a player die and then to normal when is respawned ? If is posible, how can i do that ? I need that for another script.
-
I'll put some chat boxes for players that will not exceed 160 km / h. But thanks for help !
-
I've modify: function getPlayersTrainSpeed () if ( isPedInVehicle ( localPlayer ) ) then local veh = getPedOccupiedVehicle ( localPlayer ) if ( getVehicleType ( veh ) == "Train" ) then local speed = getTrainSpeed ( veh ) outputChatBox ( "Viteza ta: " .. speed, localPlayer , 255, 0, 0 ) setTrainDerailable(tren, false) outputChatBox("Test.", localPlayer , 255, 255, 0) warpPedIntoVehicle(localPlayer , tren) setTrainSpeed(tren, 1) else end else outputChatBox ( "You must be in a train to use this command.", localPlayer , 255, 0, 0 ) end end addEventHandler ( "onClientRender", root, getPlayersTrainSpeed ) But i can't make a train.. Is this picture you can see the error (i don't know how to solve it, can you help me please): http://imgur.com/a/7BEJq
-
So, i've make this: function getPlayersTrainSpeed ( source, command ) if ( isPedInVehicle ( source ) ) then local veh = getPedOccupiedVehicle ( source ) if ( getVehicleType ( veh ) == "Train" ) then local speed = getTrainSpeed ( veh ) outputChatBox ( "You are travelling at a speed of " .. speed, source, 255, 0, 0 ) else outputChatBox ( "You must be in a train to use this command.", source, 255, 0, 0 ) end else outputChatBox ( "You must be in a train to use this command.", source, 255, 0, 0 ) end end addEventHandler ( "onClientRender", root, getPlayersTrainSpeed ) But i don't know to solve that problem with train creator. This is picture when i try to create a train from NPC.
-
And how can I make the train speed be maximum to 160km/h.
-
Isn't a table, i think. This is all script: vehiclesWindow = guiCreateWindow(395,237,241,413,"Vehicule",false) vehiclesGrid = guiCreateGridList(9,26,221,307,false,vehiclesWindow) guiGridListSetSelectionMode(vehiclesGrid,0) spawnVehicleButton = guiCreateButton(9,337,220,30,"Creează Vehicul",false,vehiclesWindow) closeWindowButton = guiCreateButton(9,373,220,30,"Ieși din Meniu",false,vehiclesWindow) guiGridListSetSortingEnabled ( vehiclesGrid, false ) vehicleName = guiGridListAddColumn( vehiclesGrid, " Numele Vehiculelor:", 0.80 ) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(vehiclesWindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(vehiclesWindow,x,y,false) guiWindowSetMovable (vehiclesWindow, true) guiWindowSetSizable (vehiclesWindow, false) guiSetVisible (vehiclesWindow, false) local customPanels = { [-2] = { vehicles = { { 410, "Scoala Auto - Manana" }, }, vehiclesColor = { 6, 6, 6, 6 }, spawnLocation = { -2068.58984375, -83.4248046875, 35.1640625, 182, -1 }, }, [-1] = { vehicles = { { 481, "BMX" }, { 510, "Mountain Bike" }, { 509, "Bike" }, }, vehiclesColor = { 1, 1, 0, 0 }, spawnLocation = { -1988.271484375, 170.7890625, 27.5390625, 2, -1 }, rentCost = 50 }, [2] = { vehicles = { { 420, "Taxi" }, { 438, "Cabbie" }, }, vehiclesColor = { 6, 6, 6, 6 }, spawnLocation = { 2125.3466796875, 2064.65625, 10.398958206177, 180, 2 }, }, [3] = { vehicles = { { 431, "Autobuz" }, }, vehiclesColor = { 6, 6, 6, 6 }, spawnLocation = { 2225.072265625, 1255.357421875, 10.766926765442, 180, 3 }, }, [4] = { vehicles = { { 574, "Mașină de Curățat" }, }, vehiclesColor = { 6, 6, 6, 6 }, spawnLocation = { 2040.244140625, 1513.951171875, 10.671875, 178, 4 }, }, [9] = { vehicles = { { 538, "Tren" }, }, vehiclesColor = { 6, 6, 6, 6 }, tren = (function () local tren = createVehicle(2864.8310546875, 1291.5625, 10.8203125,13) setTrainDerailable(tren, false) outputChatBox("Test.", source, 255, 255, 0) warpPedIntoVehicle(source, tren) setTrainSpeed(tren, 1) return tren end)(), }, [20] = { vehicles = { { 453, "Vas Petrolier Mic" }, }, vehiclesColor = { 6, 6, 6, 6 }, spawnLocation = { 2655.3505859375, -2468.4619140625, 4.4452381134033, 180, 9 }, }, [21] = { vehicles = { { 511, "Avion de Transport" }, }, vehiclesColor = { 6, 6, 6, 6 }, spawnLocation = { 389.9248046875, 2498.556640625, 16.484375, 90, 9 }, }, } local number = 0 function showCustomPanel ( nr ) nr = tonumber(nr) if not nr then return end if nr > 0 then local job = getElementData(getLocalPlayer(),"job") if job ~= nr then showJobMenu ( nr ) return end end number = nr local vehiclesList = customPanels[nr]["vehicles"] guiGridListClear ( vehiclesGrid ) for i, v in pairs( vehiclesList ) do local row = guiGridListAddRow ( vehiclesGrid ) guiGridListSetItemText ( vehiclesGrid, row, vehicleName, tostring(v[2]), false, false ) guiGridListSetItemData ( vehiclesGrid, row, vehicleName, tonumber(v[1]) ) end guiSetVisible (vehiclesWindow, true) showCursor(true,true) end addEvent("showRentPanel", true) addEventHandler("showRentPanel", root, showCustomPanel) function onCloseWindow() guiSetVisible(vehiclesWindow, false) showCursor(false,false) guiGridListClear ( vehiclesGrid ) end addEventHandler("onClientGUIClick", closeWindowButton, onCloseWindow, false) function spawnTheVehicle () local selectedVehicle = guiGridListGetItemText ( vehiclesGrid, guiGridListGetSelectedItem ( vehiclesGrid ), 1 ) if selectedVehicle == "" or selectedVehicle == " " then outputChatBox("Nu ai selectat nici un vehicul!", 225 ,0 ,0) else local selectedRow, selectedColumn = guiGridListGetSelectedItem(vehiclesGrid) local theVehicleID = guiGridListGetItemData ( vehiclesGrid, selectedRow, selectedColumn ) local thing = customPanels[number]["spawnLocation"] local x, y, z, theVehicleRoation, theVehicleJob = thing[1], thing[2], thing[3], thing[4], thing[5] local v = customPanels[number]["vehiclesColor"] local c1, c2, c3, c4 = v[1], v[2], v[3], v[4] local rentCost = customPanels[number]["rentCost"] local cost = 0 if rentCost then cost = rentCost end triggerServerEvent("spawnVehicle", localPlayer, localPlayer, x, y, z, theVehicleID, c1, c2, c3, c4, theVehicleRoation, theVehicleJob, false, cost) guiSetVisible (vehiclesWindow, false) showCursor(false,false) guiGridListClear ( vehiclesGrid ) end end addEventHandler("onClientGUIClick", spawnVehicleButton, spawnTheVehicle, false) wEmployment, jobList, bAcceptJob, bCancel = nil local job, number = 0, 0 function showJobMenu ( jobID ) job = tonumber(jobID) local realJob = getElementData(getLocalPlayer(),"job") if realJob == job then local jobsTable = customPanels[job] if jobsTable then showCustomPanel ( job ) return end end if jobID and jobs[job] then local currentJob = getElementData(getLocalPlayer(), "job") local jobName = jobs[job][1] local jobDescription = jobs[job][2] local width, height = 300, 400 local scrWidth, scrHeight = guiGetScreenSize() local x = scrWidth/2 - (width/2) local y = scrHeight/2 - (height/2) wEmployment = guiCreateWindow(x, y, width, height, "Slujba de ".. jobName, false) if (currentJob>0) then bAcceptJob = guiCreateButton(0.05, 0.85, 0.45, 0.1, "Demisionează", true, wEmployment) addEventHandler("onClientGUIClick", bAcceptJob, quitTheJob) jobList = guiCreateMemo(0.05, 0.05, 0.9, 0.7, jobs[0][2], true, wEmployment) else bAcceptJob = guiCreateButton(0.05, 0.85, 0.45, 0.1, "Acceptă slujba", true, wEmployment) jobList = guiCreateMemo(0.05, 0.05, 0.9, 0.8, jobDescription, true, wEmployment) addEventHandler("onClientGUIClick", bAcceptJob, acceptJob) end guiMemoSetReadOnly( jobList, true ) bCancel = guiCreateButton(0.5, 0.85, 0.45, 0.1, "Ieși", true, wEmployment) showCursor(true) addEventHandler("onClientGUIClick", bCancel, cancelJob) end end addEvent("showJob", true) addEventHandler("showJob", getRootElement(), showJobMenu) function closeMenu () destroyElement(jobList) destroyElement(bAcceptJob) destroyElement(bCancel) destroyElement(wEmployment) wEmployment, jobList, bAcceptJob, bCancel = nil, nil, nil, nil showCursor(false) end function startClientJob ( job ) if (job == 1) then displayTruckerJob() elseif (job == 2) then displayTaxiJob() elseif (job == 3) then displayBusJob() elseif (job == 4) then displaySweeperJob() elseif (job == 5) then --displayMechanicJob() displayPizzaJob() elseif (job == 6) then --displayLocksmithJob() elseif (job == 7) then displayTruckerJob() elseif (job == 8) then displayFishJob() elseif (job == 9) then displaytramJob() elseif (job == 20) then displayBoatJob() elseif (job == 21) then displayAirJob() end end function acceptJob ( ) if job == 1 or job == 2 or job == 3 then local carlicense = getElementData(getLocalPlayer(), "license.car") if carlicense then else outputChatBox("Ai nevoie de o licență de condus pentru a te angaja la această slujbă.", 255, 0, 0) return end end triggerServerEvent("acceptJob", getLocalPlayer(), job) outputChatBox("Ai fost angajat ca " .. jobs[job][1]..".", 0, 255, 0) startClientJob ( job ) closeMenu() end function quitTheJob() triggerServerEvent("quitJob", getLocalPlayer(), getLocalPlayer()) closeMenu() end function cancelJob(button, state) if (source==bCancel) and (button=="left") then closeMenu() end end
-
When i create a train he give me this error: ERROR: job-system\jobClient.lua:126 : attempt to index local 'thing' (a nil value) At that line the script is: local x, y, z, theVehicleRoation, theVehicleJob = thing[1], thing[2], thing[3], thing[4], thing[5] P.S: Sorry, but i beginner in LUA.
-
I've tried to convert this file in UTF-8, he want that, and in UTF-8 the error is another: ERROR: Loading script failed: job-system/jobClient.lua:1: unexpected symbol near '\'
-
[9] = { vehicles = { { 538, "Tren" }, }, vehiclesColor = { 6, 6, 6, 6 }, local tren = createVehicle(2864.8310546875, 1291.5625, 10.8203125,13), setTrainDerailable(tren, false), outputChatBox("Test.", source, 255, 255, 0), warpPedIntoVehicle(source, tren), setTrainSpeed(tren, 1), Now the error is: ERROR: Loading script failed: job-system/jobClient.lua:61: unexpected symbol near `
-
ERROR: Loading script failed: job-system/jobClient.lua:61: unexpected symbol near 'local' This is the script: [9] = { vehicles = { { 538, "Tren" }, }, vehiclesColor = { 6, 6, 6, 6 }, local tren = spawnLocation={ 2864.8310546875, 1291.5625, 10.8203125, 356, 9 }, setTrainDerailable(tren, false), outputChatBox("Test.", source, 255, 255, 0), setTrainSpeed(tren, 1),
-
I see that but i can't add local variables in that script, he give me error.
-
I see right now but i can't add a local variable because he give me error and i can't create the train separated from that script because then he will not be spawned. How can i put a local variable if i can't ? P.S: I'm beginner in LUA.
-
Isn't posible to change that varbiable from "setTrainDeraible" in 'spawnLocation' ? I've tried but it didn't work.. How can i change the variable, i can't add a local variable in that script, he give me error if i do that.
-
I added this to the scripts that create trains: [9] = { vehicles = { { 538, "Tren" }, }, vehiclesColor = { 6, 6, 6, 6 }, setTrainDerailable(myTrain, false), executeCommandHandler("speed", source), setTrainSpeed(myTrain, 1), spawnLocation = { 2864.8310546875, 1291.5625, 10.8203125, 356, 9 }, I tested it, not giving errors or warnings, but it does not work (exceeds 160 km / h). We also added scripts with "getTrainSpeed".
-
Hello ! I have tried to search google how to set the speed limit on a train but I have not found anything. Can you tell me please if possible? If possible, can you tell me how could I set the limit to 160 km / h? P.S: Excuse me if I did not write correctly.
-
The command don't use arguments. If you type just /respawnall, in chat will see "All cars will be respawned in 30 seconds". If you type /respawnall 20 or 10, in chat will see "All cars will be respawned in 20 or 10 seconds."
-
At first the command isn't executed and at second says: WARNING: AutoRespawnall/respawn.lua:6: Bad argument @ 'executeCommandHandler' [Expected string at argument 2, got player]. Is good if got player but why is not executed the command ? The command is from another script, he need to be exported ? P.S: Sorry if my english is bad.
-
setTimer(function () local player = {"Alvin_Michael"} if player then executeCommandHandler("respawnall 10", player) end end, 5000, 0) I set my character name but now he give an table. WARNING: AutoRespawnAll/respawn.lua:4: Bad argument @ 'executeCommandHandler' [Expected element at argument 2, got table] And on "addCommandHandler" is the same. WARNING: AutoRespawnAll/respawn.lua:4: Bad argument @ 'addCommandHandler' [Expected function at argument 2, got table]