-
Posts
1,050 -
Joined
-
Last visited
Everything posted by ViRuZGamiing
-
When I try to start Local server or Map Editor ingame.
-
Hello guys, My local server won't start so I can't access my Map Editor, Local Server or MTA Server.exe I do not write my IP in the 'mtaserver.conf'. Here's what the console says; = Multi Theft Auto: San Andreas v1.3.5 ================================================================== = Server name : Scripting = Server IP address: = Server port : 22003 = = Log file : ../MTA/server/mods/deathmatch/logs/server.log = Maximum players : 32 = HTTP port : 22005 = Voice Chat : Disabled = Bandwidth saving : Medium ================================================================== [15:01:14] Resource 'guieditor' requests some acl rights. Use the command 'aclre quest list guieditor' [15:01:19] Resources: 197 loaded, 0 failed [15:01:19] Starting resources... [15:01:19] Server minclientversion is now 1.3.4 [15:01:20] Querying MTA master server... failed! (6 Error downloading requested files. Couldn't resolve host name. [Could not resolve host: master.mtasa.com] [a dd.php?g=22003&a=22126&h=22005&v=1.3.5-9.06531&x=0_32_0_1_1&ip=]) [15:01:20] Server started and is ready to accept connections! [15:01:20] To stop the server, type 'shutdown' or press Ctrl-C [15:01:20] Type 'help' for a list of commands. Line 18-20 is the problem as you can see.
-
Today or later?
-
Cheez r u an PHP Scripter? you keep using those ';' while they're not needed. @Miika perhaps 'onPlayerSpawn' is better because if they die they'll lose skin or make 'onPlayerDeath'
-
I think it is something with the triggers
-
Hi guys, i've made a Train script and it works but I have 1 little problem and that is timing. The script does things in the wrong order. What needs to happen is; • on Destination Marker hit > give player 1000$ > setPlayerPosition and Rotation > Delete Marker and Train What actually happens is; > gives the money > deletes the train and marker > no setPlayerPosition Here's the code; • Server function startTrainJob () local thePlayer = source trainVehicle = createVehicle(538, -1947.7, 140.8, 27.4) --setElementAlpha(trainVehicle, 150) function jobsDoneServer() destroyElement(trainVehicle) givePlayerMoney(thePlayer, 1000) triggerClientEvent("destroyDestinationMarker", thePlayer) setElementPosition(thePlayer, -1964.3, 138, 27.7) setElementRotation(thePlayer, 0, 0, 90) end addEvent("onTrainJobFinish", true) addEventHandler("onTrainJobFinish", root, jobsDoneServer) if getElementType ( thePlayer ) == "player" then warpPedIntoVehicle(thePlayer, trainVehicle) triggerClientEvent("onStartTrain", thePlayer) else outputChatBox("Syntax Error!", thePlayer, 255, 100, 0) end function onExitTrain() setElementPosition(thePlayer, -1964.3, 138, 27.7) setElementRotation(thePlayer, 0, 0, 90) destroyElement(trainVehicle) triggerClientEvent("destroyDestinationMarker", thePlayer) end addEventHandler("onVehicleExit", trainVehicle, onExitTrain) end addEvent("startTrainJob", true) addEventHandler("startTrainJob", root, startTrainJob) • Client GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() slantFont = guiCreateFont( "slant.ttf", 15 ) trainGUI = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "Train Job", true) guiWindowSetSizable(trainGUI, false) guiSetVisible(trainGUI, false) trainStartButton = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Start Job!", true, trainGUI) guiSetFont(trainStartButton, slantFont) guiSetProperty(trainStartButton, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", trainStartButton, trainWindowClose, false) addEventHandler("onClientGUIClick", trainStartButton, triggerTrainServer, false) trainCloseButton = guiCreateButton(0.67, 0.61, 0.20, 0.16, "Close", true, trainGUI) guiSetFont(trainCloseButton, slantFont) guiSetProperty(trainCloseButton, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", trainCloseButton, trainWindowClose, false) trainGUIMemo = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Press the 'start job!' button to start the Train Job", true, trainGUI) guiMemoSetReadOnly(trainGUIMemo, true) end ) trainMarker = createMarker(-1958.3, 137.89999, 26.7, 'cylinder', 2.5, 0, 100, 255, 255) function trainWindowOpen(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(trainGUI, true) showCursor( true ) end end addEventHandler("onClientMarkerHit", trainMarker, trainWindowOpen) function trainWindowClose() guiSetVisible (trainGUI, false ) showCursor ( false ) end function triggerTrainServer() triggerServerEvent("startTrainJob", localPlayer ) end function startTrain() destinationMarker = createMarker(1436.6, 2634.2, 9.8, 'cylinder', 7, 0, 100, 255, 255) function jobsDone() triggerServerEvent("onTrainJobFinish", localPlayer) end addEventHandler("onClientMarkerHit", destinationMarker, jobsDone) function destroyDestinationMarker() destroyElement(destinationMarker) end addEvent("destroyDestinationMarker", true) addEventHandler("destroyDestinationMarker", root, destroyDestinationMarker) end addEvent("onStartTrain", true) addEventHandler("onStartTrain", root, startTrain) Thanks in advance and tell me how I can know which comes first and how I can time things right. Regards ViRuZ
-
This freezes the time, you took the wrong example addEventHandler( 'onClientRender', getRootElement( ), function( ) setTime( 1, 0 ) end )
-
Edited, how 'bout now?
-
Lol you were faster
-
Bool isn't something you're supposed to write. you'll need something like this; function fixVeh (thePlayer) local theVehicle = getPlayerVehicle ( thePlayer ) if theVehicle then fixVehicle(theVehicle) else outputChatBox("You don't have vehicle", thePlayer) end addCommandHandler("fix", fixVeh) not tested.
-
Did some research okay i know what childern and root are. First I've created an XML on command function createFileHandler() if xmlLoadFile(":xmltest/vehicles.xml") then outputChatBox("Succesfully loaded!", thePlayer) else local vehicles = xmlCreateFile("vehicles.xml"," vehicles") local SF = xmlCreateChild(vehicles, "SF") local SFCar1 = xmlCreateChild(SF, "Car 1") local SFCar2 = xmlCreateChild(SF, "Car 2") local SFCar3 = xmlCreateChild(SF, "Car 3") local LS = xmlCreateChild(vehicles, "LS") local LSCar1 = xmlCreateChild(LS, "Car 1") local LSCar2 = xmlCreateChild(LS, "Car 2") local LSCar3 = xmlCreateChild(LS, "Car 3") local LV = xmlCreateChild(vehicles, "LV") local LVCar1 = xmlCreateChild(LV, "Car 1") local LVCar2 = xmlCreateChild(LV, "Car 2") local LVCar3 = xmlCreateChild(LV, "Car 3") xmlSaveFile(vehicles) outputChatBox("File created!", thePlayer) end end addCommandHandler("createfile", createFileHandler) The above part works but now I wanted to try and use it and this didn't work for me. No Errors. addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() local xml = xmlLoadFile("vehicles.xml") local vehicleNodes = xmlNodeGetChildren(xml) g_Vehicles = {} for i,node in ipairs(vehicleNodes) do g_Vehicles[i] = xmlNodeGetValue(node) end xmlUnloadFile(xml) end ) addCommandHandler("createvehicle", function() local allVehicles = #g_Vehicles local vehicle = g_Vehicles[math.random(allVehicles)] createVehicle(vehicle) end ) When I put some Coordinates in the XML Childern it resets
-
Already made this and works: function createFileHandler() if xmlLoadFile(":xmltest/new.xml") then outputChatBox("Succesfully loaded!", thePlayer) else local RootNode = xmlCreateFile("new.xml"," newroot") local NewNode = xmlCreateChild(RootNode, "newchild") xmlSaveFile(RootNode) outputChatBox("File created!", thePlayer) end end addCommandHandler("createfile", createFileHandler) Creates this: < newroot> >> newroot> But idk what Root and Child are.
-
Hello guys, I'm about to improve my script from Tables to XML but I need to know something about it. Could you guys explain me some XML Functions and which ones I need to use. Probably; xmlCreateFile xmlLoadFile xmlSaveFile
-
Thx for the suggestion i'll try and learn some new stuff to improve it like you said. XML would be easier but it's hard to learn. Adding multiple shops is already possible in the code but i'll put some new ones in. I'll keep you updated!
-
Fixed a bug and uploaded a fixed version.
-
Okay works fine! Thanks
-
could I change; if getTeamName(police) == "Police" then into if isPlayerInTeam( police, 'Police' ) then
-
Basicly when you enter the game you're not assigned to a team, But the script searches for the team "Police" and doesn't find one because i'm not in it. It only needs to check if i'm in team "Police" when i'm actually in a team.
-
It does work, the problem is when I start the script i'm not in a team so it gives the error can I prevent it to check if I'm in the team Police when my team is empty
-
Nice works How 'bout this:
-
Also a problem here, Console only outputs 1 and 4 outputConsole("1") -- Bind Key F2 function bindKF2 () bindKey("F2", "down", function () outputConsole("2") local playerTeam = getTeamName(getPlayerTeam ( getLocalPlayer ( ) )) if ( playerTeam == "Police" ) then outputConsole("3") guiSetVisible (policeF2Window, true) showCursor (true) else return end end) end outputConsole("4")
-
Server side function trigger by a client side, Error bad argument @ getTeamName local thePlayer = source police = getPlayerTeam (thePlayer) if ( getTeamName ( police ) == "Police" ) then
-
Gonna try it out
-
Hello, My GUI won't open when i'm in the Team called Police with F2. No Error's or Debug, Script: