Jump to content

BladeArtist

Members
  • Posts

    13
  • Joined

  • Last visited

BladeArtist's Achievements

Square

Square (6/54)

0

Reputation

  1. I did check out like two other topics with the same problems... I sent him the links to the provided solutions but according to him it was unsuccessful. Then he told me to make this post. I suppose I can ask him to try that stuff again. [EDIT] He says another error that pops up is: "ERROR: Loading mod (/root/mta/mta-blade/mods/deathmatch/deathmatch.so) failed!" [sOLVED] apparently another error he was getting contained "libsqlite3.so.0", so he just did: apt-get install libsqlite3-dev So I guess, "apt-get install libprce3 apt-get install libsqlite3-dev" is the fix for this thing. Anyway, thanks for the help, BladeArtist
  2. So basically, I don't really know anything about how to run a server, and I'm making this post for a friend. Anywho, the server OS is Debian 5 32bit, and when the mta-server is run, you get this: ./mta-server: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory ./ Solutions from other threads have been tried, such as.. apt-get install libpcre3 ... what ever that means. Any helpful input would be appreciated, Thanks in advance, BladeArtist
  3. Show me the function that triggers your event, please. As far as I know, the problem is not this function here. Also, the semicolon( after givePlayerMoney() isn't necessary. Anyway, the function that triggers this event should be passing the parameter "killer", since you're using it in the handler. i.e. something like: triggerServerEvent("onZombieWasted", zombieElement, killer [, other parameters]) where "zombieElement" is defined within the scope of this event trigger, before you trigger it, as well as the "killer" variable (that being a player element). I would really have to see the rest of your script to be able to help you better. I have no idea how you're handling these "zombie elements", for instance. Hope that helps a little, BladeArtist
  4. It works now. All I need to do is: setElementInterior(getLocalPlayer(), 14) -- clientside works just fine Strange, huh? Guess the camera can only show the interior your player element is in? And in this case, I don't really get what setCameraInterior() is even for. I would still like someone more familiar with the system to enlighten me a bit, but hey, it works. Thanks for the replies, guys, BladeArtist [sOLVED]
  5. Ah, my hypothesis would be correct then. Can I circumvent this or should I just ignore it? Yes, I did use it, this is the exact stuff I used: -- stuff fadeCamera(true) Dummy = createPed(34, 0, 0, 3) setElementInterior(Dummy, 14, 205, -165, 1000.6) setCameraInterior(14) setCameraMatrix(204, -165, 1001, 205, -165, 1001) K that wasn't EXACTLY what I had when I encountered the problem. I changed it to this, and what happens now is: - camera fades, it goes very dark - I see a faint ghost of a ped falling And if you check the wiki, in interior 14, at 205,-165,1000.5 there is a Ds clothes shop. Doesn't display it correctly here though. What am I doing wrong? [EDIT] it also seems like every time I set the interior of the camera and tab out of the game and tab back in, the entire screen is black (or otherwise messed up, have to restart the game) [EDIT2]This works just fine: function makePedInDs() local Dummy = createPed(14, 0, 0, 0) setElementInterior(Dummy, 14, 205, -165, 1000.6) end addCommandHandler("makeDsPed", makePedInDs) [EDIT3]I added this thing: function printCamMatrix() local Mat = {} Mat.x,Mat.y,Mat.z,Mat.tx,Mat.ty,Mat.tz = getCameraMatrix() local strs = {} strs.x,strs.y,strs.z,strs.tx,strs.ty,strs.tz = "camera X","camera Y","camera Z","target X","target Y","target Z" for k, v in pairs(Mat) do outputChatBox(strs[k] .. ": " .. v) end end addCommandHandler("camMat", printCamMatrix) With it, I started the gamemode, teleported into the interior, aimed my camera just right and ran that command. It printed me with the PERFECT coordinates, which I used (with two decimals) to set the cam matrix in my original script. And it STILL just displays dark. I'm sure I'm setting the interior to 14 as well. So I have no idea what is going on [EDIT4] I realize I've seriously derailed the topic, and I'm sorry about that. You could change the title of the thread or something maybe? Anyway, I've tried a lot of things now, and whatever I do, I can't seem to be able to set the camera interior and matrix to this interior properly. I haven't tried other interiors, so I guess it could be a problem with this specific one. So, has anyone done this specific interior with setCameraMatrix()? How about interiors in general? Is there anyone who can spot what I'm doing wrong, if I am? I'm addressing anyone who has actually used this before. Thanks again for the help, BladeArtist [EDIT5] Also tried moving my not-yet-spawned player element to this interior, just incase it's out of my stream or whatever? Like if for some reason it's streaming based on my player element's location and not the camera's. Yet alas, no success =/ Problem persists.
  6. Alright, well, first of all: What RPG resource? And what login resource, for that matter? If this login resource utilizes the built-in accounts system, then the onPlayerLogin could work. You're right, it's a server event, so it wouldn't trigger anything client-side, however, you could trigger a client event on the RPG's server side script when a login occurs, and then only draw the GUI after the login has happened instead of "onResourceStart" or what ever. So for instance: RPG server code: function drawGUIOnLogin() triggerClientEvent("onPlayerLoginC", source) end addEventHandler("onPlayerLogin", getResourceRoot(), drawGUIOnLogin) client side: function drawCharacterMenu() createCharMenu() --this is whatever would usually get called at resource start end addEvent("onPlayerLoginC", true) addEventHandler("onPlayerLoginC", getResourceRoot(), drawCharacterMenu) OR: just change the original draw function to include the guiSetVisible(false) function createCharMenu() -- this is the function that's already there, creating the GUI -- stuff that creates GUI elements -- guiSetVisible(Wnd, false) -- wnd = the frame element that was just created, just add this line end function toggleCharWndVisibility() if guiGetVisible(Wnd) == true then -- Wnd is your character window thingy's element pointer guiSetVisible(Wnd, false) else guiSetVisible(Wnd, true) end end addEvent("onPlayerLoginC", true) addEventHanlder("onPlayerLoginC", getResourceRoot(), toggleCharWndVisibility) Now there's no guarantee ANY of this will work, I just kinda winged it, and it's all untested But you get the idea, right? [EDIT] Ah, well... nvm that then. Glad you got it to work.
  7. Well, if you've read the GUI tutorials (on the wiki, see here and here), you know they add a "guiSetVisible(WindowElement, false)" at the end of the definition of the window, which is loaded when the resource starts. You can then toggle the visibility of the windows by using the same function (guiSetVisible). Is this something you've neglected, or are you for some reason going for another kind of solution? If so, could I have some more details about how you've set things up, so we can look at alternatives? [EDITed] Added links, fixed typo
  8. Ok, so basically I have this ped, with CJ's skin, in some kind of state of suspended falling just under the farm at 0,0,0. [situation updated a little bit, see below in [EDIT]] [update2: the ped mystery is solved, but the (offtopic) problem described under P.S. is still unsolved] [update3: it's all solved now, thx for the input ppl] screenie: At first I thought it was something I was doing wrong, but after turning off not only my own gamemode etc. I also turned off every non-essential resource, so in the end I only had: admin, ajax, resourcebrowser, resourcemanager and webadmin on, and the ped was still there. So, basically what I'm asking here is: Is it supposed to be there? Why is it there? If not, what could I be doing wrong? If it IS there on purpose, what can I do to remove it (makes this annoying falling sound)? Thanks in advance, BladeArtist [EDIT (after P.S. below, chronologically] I spawned myself via admin panel and set myself as the camera target, and when I set my camera matrix to 0,0,2,0,0,0 again, the ped seemed to have disappared. So is it reasonable to conclude this mystery ped is myself? If so, is it client-side? Or will it have a giant pile of people when they join the server but dont log in straight away? I don't see why it would work this way, am I missing something? Thanks again, BladeArtist P.S. Oh and while I'm at it, there's this other question I have too. I'm trying to make a skin selection thing, in which I add a dummy ped, bring it into an interior and set the camera matrix so it's targeted at this dummy ped, but for some reason it's not working, the screen just goes nearly black (fooled around with this a bit, and it seems there's a black spot at the interior's coordinates, but when I teleport there with the "admin" resource, it works just fine, though ). So what would be the correct steps to accomplish the following (a simple explanation should suffice): - make a dummy ped the skin of which I can change - have it be in an interior of some description - make it so I can see said ped as well =P I'm also trying to do this all client-sided -- do-able?
  9. LMAO Oh my god, lol, such a tiny mistake can make such a huge difference.. Laughed my ass off when I found it, it was in the .map file: <map> <spawnpoint id="initspawn" posX="0" posY="0" posZ="3" rot="0" model="0"/> <marker id="cops" posX="50" posY="0" posZ="20" r="0" g="0" b="255" /> <marker id="robbers" posX="-50" posY="0" posZ="20" r="255" g="0" b="0" /> <radararea id="initspawn" posX"0" posY="0" r="200" g="200" b="0" /> </map> fifth line, posX"0" Thanks for the help, guys. Mods may erase this thread for all I care. [EDIT] Well there IS still that thing with my quithandler SQL thingy not working, but I'll figure that out... [EDIT2] Yeah I fixed that too - apparently SQLite's datatypes differ a bit from MySQL (floatating point numbers are "REAL" etc.). Also changed "getPlayerName(source)" to correctly get the characters name, setting/getting metadata attached to the player. Thanks again for the input, people. [ Go ahead and close this, if you want, mods ]
  10. Anyone? I must be misunderstanding the map system somehow, since I'm not getting the map data out of the file, or am I? I can't figure out where I'm going wrong.. Any takers? thanks [EDIT] outputChatBox(tostring(#spawnpoints)) prints out "0", so the table would appear to be empty, but why? [EDIT] Also did this: mapRoot = getResourceRootElement(startedMap) outputChatBox(tostring(mapRoot)) and it returns "userdata: 000000F3", so it's definately something, at least?
  11. Done. I'm getting "ERROR: ...er/mods/deathmatch/resources/cnr/server/gamemode.lua:62 attempt to perform arithmetic on local 'x' (a boolean value)" [EDIT - 15:11 UTC+2] The third argument is optional, but I just realized I DO need to have it. Changed to: executeSQLUpdate("accounts", "posX ='" .. x .. "', posY='" .. y .. "', posZ='" .. z .. "'", "name='" .. getPlayerName(source) .. "'") => I still get "Bad argument @ 'executeSQLUpdate' - Line: 179" Well I was hoping not to post ALL of my gamemode in public like this, but meh.. The function joinSpawn() is being called by my custom event, called from a clientside GUI addEvent("onGameJoin", true) addEventHandler("onGameJoin", getRootElement(), joinSpawn) clientside: function onJoinButton() outputChatBox("DEBUG: Join button pushed") triggerServerEvent("onGameJoin", getLocalPlayer(), getLocalPlayer()) showCursor(false) guiSetInputEnabled(false) guiSetVisible(ControlPanel, false) end __________________________________________________________________ Final altered code (the parts relevant, anyway): function loadMap(startedMap) outputChatBox("SERVER: DEBUG: loadMap - called") spawnpoints = getElementsByType("spawnpoint", source) local markers = getElementsByType("marker", source) local radarareas = getElementsByType("radararea", source) --[[ for k,v in ipairs(markers) do local marker = createMarker(getElementData(v, "posX"), getElementData(v, "posY"), getElementData(v, "posZ")) setMarkerColor(marker, getElementData(v, "r"), getElementData(v, "g"), getElementData(v, "b")) setElementData(marker, "id", getElementData(v, "id")) outputChatBox("DEBUG: Marker created: " .. tostring(marker)) end --]] if spawnpoints and spawnpoints ~= {} then outputChatBox("spawnpoints loaded") else outputChatBox("spawnpoints aren't being loaded") end for k, v in pairs(spawnpoints) do outputChatBox(getElementData(spawnpoint, "id")) end --[[ for k,v in ipairs(radarareas) do posX = getElementData(v, "posX") posY = getElementData(v, "posY") r = getElementData(v, "r") g = getElementData(v, "g") b = getElementData(v, "b") local radararea = createRadarArea(posX - 20, posY - 20, 40, 40, r, g, b) setElementData(radararea, "id", getElementData(v, "id")) outputChatBox("DEBUG: Radararea created") end --]] end addEventHandler("onGamemodeMapStart", getRootElement(), loadMap) (commented out some non-crucial stuff) function joinSpawn(ply) outputChatBox("SERVER: DEBUG: joinSpawn - called") local x = getElementData(ply, "lastX") local y = getElementData(ply, "lastY") local z = getElementData(ply, "lastZ") if x and y and z then outputChatBox("Welcome back!", ply) fadeCamera(ply, true) spawnPlayer(ply, x, y, z+1) setCameraTarget(ply, ply) else outputChatBox("First time playing, " .. getPlayerName(ply) .. "?", ply) for k,v in pairs(spawnpoints) do if getElementData(v, "id") == "initspawn" then loginpoint = v end outputChatBox(tostring(v)) end local x = getElementData(loginpoint, "posX") local y = getElementData(loginpoint, "posY") local z = getElementData(loginpoint, "posZ") fadeCamera(ply, true) spawnPlayer(ply, math.random(x-20,x+20), math.random(y-20,y+20), z) setCameraTarget(ply, ply) end end addEvent("onGameJoin", true) addEventHandler("onGameJoin", getRootElement(), joinSpawn) (edited to "outputChatBox("First time playing, " .. getPlayerName(ply) .. "?", ply)" so I know ply exists, and it does) ERRORS: "WARNING: gamemode.lua: Bad argument @ 'getElementData' - Line : 58" ( = line 19 in this post, since I omitted parts of my code) " < Same thing > - Line : 59" " < Same thing > - Line : 60" "ERROR: ...er/mods/deathmatch/resources/cnr/server/gamemode.lua:62: attempt to perform arithmetic on local 'x' (a boolean value)" after I leave: "WARNING: gamemode.lua: Bad argument @ 'executeSQLUpdate' - Line: 179" So basically, "local x = getElementData(loginpoint, "posX")" is getting a boolean value (false?) and my SQL query is somehow malformed. The SQL in it's current form: executeSQLUpdate("accounts", "posX ='" .. x .. "', posY='" .. y .. "', posZ='" .. z .. "'", "name='" .. getPlayerName(source) .. "'") ... empty line to get the horizontal scroll bar enabled ... (line numbers on/off is still broken) Any ideas? Thanks again
  12. Hey, thanks for the quick reply. I'm getting "SERVER: DEBUG: loadMap - called" and "spawnpoints loaded", which obviously isn't actually happening ... because further in the program I do function joinSpawn(ply) outputChatBox("SERVER: DEBUG: joinSpawn - called") local x = getElementData(ply, "lastX") local y = getElementData(ply, "lastY") local z = getElementData(ply, "lastZ") if x and y and z then outputChatBox("Welcome back!", ply) fadeCamera(ply, true) spawnPlayer(ply, x, y, z+1) setCameraTarget(ply, ply) else outputChatBox("First time playing?", ply) for k,v in pairs(spawnpoints) do if getElementData(v, "id") == "initspawn" then loginpoint = v end outputChatBox(tostring(v)) end local x = getElementData(loginpoint, "posX") local y = getElementData(loginpoint, "posY") local z = getElementData(loginpoint, "posZ") fadeCamera(ply, true) spawnPlayer(ply, math.random(x-20,x+20), math.random(y-20,y+20), z) setCameraTarget(ply, ply) end end and it says getElementData is being called with invalid arguments and also that I'm trying to run arithmetic on a boolean value x (in math.random) [EDIT] Boolean error is on line 62, in loginSpawn() not in the quit handler - my bad, should've been specific the only problem with the quithandler is "bad argument"
  13. [EDIT] Problem solved. Hey, Can you tell me what's wrong with this? [EDIT] This code below is outdated, changed code in follow-up posts function loadMap(startedMap) outputChatBox("SERVER: DEBUG: loadMap - called") local mapRoot = getResourceRootElement(startedMap) spawnpoints = getElementsByType("spawnpoint", mapRoot) local markers = getElementsByType("marker", mapRoot) local radarareas = getElementsByType("radararea", mapRoot) for k,v in ipairs(markers) do local marker = createMarker(getElementData(v, "posX"), getElementData(v, "posY"), getElementData(v, "posZ")) setMarkerColor(marker, getElementData(v, "r"), getElementData(v, "g"), getElementData(v, "b")) setElementData(marker, "id", getElementData(v, "id")) outputChatBox("DEBUG: Marker created: " .. tostring(marker)) end if spawnpoints then outputChatBox("spawnpoints loaded") else outputChatBox("spawnpoints aren't being loaded") end for k, v in ipairs(spawnpoints) do outputChatBox(getElementData(spawnpoint, "id")) end for k,v in ipairs(radarareas) do posX = getElementData(v, "posX") posY = getElementData(v, "posY") r = getElementData(v, "r") g = getElementData(v, "g") b = getElementData(v, "b") local radararea = createRadarArea(posX - 20, posY - 20, 40, 40, r, g, b) setElementData(radararea, "id", getElementData(v, "id")) outputChatBox("DEBUG: Radararea created") end end addEventHandler("onGamemodeMapStart", getRootElement(), loadMap) and here's the map: <map> <spawnpoint id="initspawn" posX="0" posY="0" posZ="3" rot="0" model="0"/> <marker id="cops" posX="50" posY="0" posZ="20" r="0" g="0" b="255" /> <marker id="robbers" posX="-50" posY="0" posZ="20" r="255" g="0" b="0" /> <radararea id="initspawn" posX"0" posY="0" r="200" g="200" b="0" /> </map> It would appear that the tables inside the elements table are empty or something, because I'm not getting any errors, but I'm not seeing any elements being spawned either. Thanks in advance. P.S. Oh and while you're at it, this isn't working either function quitHandler(quitType) local x, y, z = getElementPosition(source) if x and y and z then outputConsole(x .. y .. z) executeSQLUpdate("accounts", "posX ='" .. x .. "', posY='" .. y .. "', posZ='" .. z .. "'") local nick = getPlayerName(source) outputChatBox("Player " .. nick .. "has left the game - " .. quitType .. ".") end end addEventHandler("onPlayerQuit", getRootElement(), quitHandler) Apparently executeSQLUpdate is getting an invalid argument, maybe x y z are boolean or something? [EDIT] Boolean error is on line 62, in loginSpawn() not in the quit handler - my bad, should've been specific
×
×
  • Create New...