-
Posts
122 -
Joined
-
Last visited
Everything posted by John_Scott
-
That must be the cause, it only returns the camera matrix if it was set using setCameraMatrix. Oh, so this function works only in client side like this?! Thank you!
-
Hi! I have a problem with the 'getCameraMatrix' function. I would like to prit the camera matrix positions to the chat, but an error shows up every times. Code: (server side) local cx,cy,cz,lx,ly,lz = getCameraMatrix(playerSource) outputChatBox("Camera matrix: " .. cx .. ", " .. cy .. ", " .. cz .. ", " .. lx .. ", " .. ly .. ", " .. lz .. " ", playerSource) Error: When I add this thing to the code: if not lz then lz = 0 end The error say the ly pos, so all of these coordinates are nil How can I fix this? Thanks for helping!
-
You're right, it was the problem. Thank you!
-
Hi! I have a problem with a timer funtcion. I would like to call the main function more thank 1 time, and the timer inside the main function can count only once. Code: function drawKillingText() if (text) then local screenW, screenH = guiGetScreenSize() dxDrawText ( text, screenW / 2, 100, screenWidth, screenHeight, tocolor(255, 255, 255, 255), 2, "arial", "center", "center", true, false, false, true ) setTimer (function() text = "" end, 1250, 1 ) end end addEventHandler ( "onClientRender", root, drawKillingText ) So, when the dxDraw text shows up for 1250ms the timer function reset that, but if I call the function agait, the timer can't start. How can I do this? Exit from the function, or reset the timer? Thanks for helping!
-
Oh, thank you very much!
-
I can't understand. Where need to place 'true' then?
-
Hi! I have a problem with the 'dxDrawText' function. I red in the wiki, if I change the color code argument '(tocolor, 0, 0, 0, 0)' to 'true', the text is colored by the HTML color codes, but if I do that, just get an error about placed boolean where integer requested. Code: dxDrawText ( "Killed: " .. murdered .. " +100", screenW / 2,100, screenWidth, screenHeight, true, 1.02, "pricedown", "center", "center" ) How can I allow these color formats then? Thanks for helping!
-
Thank you very much!
-
Hi! I would like to show the other players in the radar for everyone except myself. How can I do it? I have no idea Thanks for helps!
-
Hi! I yould like to create a vehicle shop with a duplication protection, so I would like to add an internal ID to every bought vehicle, and when the player spawn that, the scrip remove the old one. (If I buy a Bullet, go away and spawn it, again go away, again spawn it, the script remove the first Bullet) Thanks for the helping!
-
Thank you very much!
-
Hi! Can someone help me with add items to a GridList from an array? I would like to set weapon IDs, Names, Prices in a Array, like this: weapons = { "31";"M4";"100", "29";"MP5";"75", "30";"AK47";"90" } Place the ID to the first column, the name to the second and the price to the third. Thanks for the helps!
-
If you no have enought time to give me a true answer, why give me any answer? I know these functions, but I can't use to what I would like.
-
Hi! First thing: I would like to create a few markers to my sevrvers and set a category to everyone, like: <marker posX="2158.87" posY="943.16" posZ="11.5" type="arrow" category="gunshop"/> Now, i just need to playce all of these markers to the server, but IDK how to load all lines from this file. Second thing: I would like to add a category to all marker, to decide it's a gunshop, a vehicleshop, or what?! How can I get this value in the onMarkerHit function, like this?: if (*markertype == "gunshop") then *Show gunshop GUI* elseif (*markertype == "vehicleshop") then *Show vehicleshop GUI end Thanks for all help!
-
Because this video contain a lot of famous music, i can't upload to YouTube, but you can watch on my webpage, here: http://john-scott.net/z-land_dayz_szerver/
-
I now use the onPlayerLogin, i place the function's call to the XML login: function PlayerLogin(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(source, account, password) triggerClientEvent (source,"hideLoginWindow",getRootElement()) if checksave == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end loadAccountData() else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Wrong username and/or password") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Please enter your password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Please enter your username!") end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)
-
Not working too with this, but the data saveing is working, the load is not
-
Yes, after the register, write to tchatbox: Skin, Money, Team, but after reconnect and log in, only write the money, but wront value: 0
-
Already try it, but doesn't work Code: function saveAccountData(thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) if ( playeraccount ) then -- Save Money local playermoney = getPlayerMoney ( thePlayer ) setAccountData ( playeraccount, "tg.money", playermoney ) outputChatBox("Money: " .. playermoney) --Save Team local theTeam = getPlayerTeam ( thePlayer ) local playerTeam = getTeamName ( theTeam ) setAccountData ( playeraccount, "tg.team", playerTeam ) outputChatBox("Team: " .. playerTeam ) --Save Skin local playerSkin = getElementModel ( thePlayer ) setAccountData ( playeraccount, "tg.skin", playerSkin ) outputChatBox("Skin ID: " .. playerSkin) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), saveAccountData ) addCommandHandler("save-all", saveAccountData) function loadAccountData() local playeraccount = getPlayerAccount (source) if ( playeraccount ) then -- Spawning Player local gx, gy, gz = 2500.9230957031, -1671.9180908203, 13.787899971008 spawnPlayer (source, gx, gy, gz, 0, 0, 0, 0, nil) setCameraTarget ( source, source) outputChatBox("Spaswned") --Load Team local playerTeam = getAccountData ( playeraccount, "tg.team" ) local theTeam = getTeamFromName ( "playerTeam" ) setPlayerTeam ( source, theTeam ) --Load Skin local playerSkin = getAccountData ( playeraccount, "tg.skin" ) setElementModel(source, playerSkin) -- Load Money local playermoney = getAccountData ( playeraccount, "tg.money" ) setPlayerMoney ( source, playermoney ) end end
-
Now working now too Save data: function saveAccountData(source) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then -- Save Money local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "tg.money", playermoney ) outputChatBox("Money: " .. playermoney) --Save Team local theTeam = getPlayerTeam ( source ) setAccountData ( playeraccount, "tg.team", getTeamName ( theTeam ) ) outputChatBox("Team: " .. theTeam) --Save Skin local playerSkin = getElementModel ( source ) setAccountData ( playeraccount, "tg.skin", playerSkin ) outputChatBox("Skin ID: " .. playerSkin) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), saveAccountData ) addCommandHandler("save-all", saveAccountDat a) Load data: function loadAccountData() local playeraccount = getPlayerAccount (source) if ( playeraccount ) then --Load Team local playerTeam = getAccountData ( playeraccount, "tg.team" ) --Load Skin local playerSkin = getAccountData ( playeraccount, "tg.skin" ) -- Spawning Player local gx, gy, gz = 2500.9230957031, -1671.9180908203, 13.787899971008 spawnPlayer (source, gx, gy, gz, 0, playerSkin, 0, 0, getTeamFromName ( playerTeam) ) setCameraTarget ( source, source) outputChatBox("Spaswned") -- Load Money local playermoney = getAccountData ( playeraccount, "tg.money" ) setPlayerMoney ( source, playermoney ) end end Error: http://kepfeltoltes.hu/131222/error_www ... es.hu_.png
-
Hi, I have a problem witht my script. I would like to save the player's team when he quit, and load/set when logging in, but my code is not workins Quit: function saveAccountData(source) local theTeam = getPlayerTeam ( source ) setAccountData ( playeraccount, "tg.team", theTeam ) end Connect: function loadAccountData() local playerTeam = getAccountData ( playeraccount, "tg.team" ) -- Spawning Player local gx, gy, gz = 2500.9230957031, -1671.9180908203, 13.787899971008 spawnPlayer (source, gx, gy, gz, 0, playerSkin, 0, 0, playerTeam) setCameraTarget ( source, source) end Thanks for help!
-
Thanks for everyone, i made sucessfull. When you want to check: mtasa://37.17.173.26:22003
-
Okay, i use an blurred image, but how i can get my camera's current position, and picture without all HUD?
-
Hi, I would like to create blurred screen to my server in the login panels's background. my login panel is a GUI window, and when it show, the camera is set to a matrix. I like to set the camera screen to blurred, like FFS. How i can make this with an fx? Thanks for help!
-
Hi, I wrote a script for my DayZ server, witch ban player to 2 dayz, when he log out in combat. (combat = when a player was shooted, or shoot someone) But the code have a bug, when a client go to combat status, the server side script move everyone to combat, not only the fighters. Can someone debug my code? Code: http://pastie.org/8555999