Jump to content

Lukkaz

Members
  • Posts

    135
  • Joined

  • Last visited

Everything posted by Lukkaz

  1. Yeah my resources all fun on dependancies but that are all specified in each meta file.
  2. I have an issue where on initial start up some resources don't work unless you restart them. Is there a way to fix this issue so they all run as they should? NOTE, in the mtaconfig they are all in alphabetical order so I don't know if I should put the login screen first or if there's any particular order. Thanks guys.
  3. now it doesnt work at all...
  4. function iceBreaker() addEventHandler("onClientClick", getRootElement(), convoReply) addEventHandler("onClientRender", getRootElement(), convoDX) end addEvent("breakIce", true) addEventHandler("breakIce", getRootElement(), iceBreaker) function convoEnd() removeEventHandler("onClientClick", getRootElement(), convoReply) removeEventHandler("onClientRender", getRootElement(), convoDX) setCameraTarget(getLocalPlayer()) showCursor(false) cLevel = 1 cOption = 1 end addEvent("endConvo", true) addEventHandler("endConvo", getRootElement(), convoEnd)
  5. I toggle my DX menus with add/remove event handlers. However when a player adds an event handler every player in the server can see the menu. Is there a way to disable it / enable it for the one person rather than the while server?
  6. I am trying to think of an idea for an inventory screen. Valhalla's inventory screen is perfect however I don't have the script and don't want it because 99% of servers now use vG. But the positioning of their inventory screen is perfect and the usage is very convenient and small. Anyone have any ideas for a unique inventory screen?
  7. Well I am developing a FP view for players so they can still aim their gun ect. what would be the best way?
  8. it works now the only thing left is moving the verticle axis. Looking up and down. I will try to play around with it but any help again is appreciated.
  9. No that's onClientMouseMove like I said it works but I want it so the player can rotate at a still state.
  10. Hey everyone I am in need of a little help. As you know by playing mta when you run you can rotate the player with moving the mouse. However when you move the mouse when your sitting still the camera moves around the still ped. My question is how can I make the still ped rotate so his back is always to the person playing the game? My code so far; addEventHandler( "onClientCursorMove", getRootElement( ), function ( cursorX, cursorY, absoluteX, absoluteY, x,y,z) pedday = getLocalPlayer() if (getElementVelocity(pedday) <= 0) then curX, curY, curZ = getElementRotation(getLocalPlayer()) setElementRotation(pedday, curX , y, z) setPedLookAt(pedday, x, curX , curY, z, -3000) end end ) doesn't currently work, the ped gets messed up when in motion and the mouse is moved. ANy help or ideas is really appreciated thanks guy!
  11. EPIC!!!! Thank you so much!!!
  12. Solid, didn't work. JR it is not a mysql issue or else the peds wouldn't be set to the correct skin IDs. Here is my current code. pedTable = {} function createPeds(client) local i = 1; -- character limit local accountID = getElementData(client, "gameaccountid") local playerid = getElementData(client, "playerid") results = mysql:query("SELECT id, charactername, cked, lastarea, age, gender, faction_id, faction_rank, skin, DATEDIFF(NOW(), lastlogin) as llastlogin FROM characters WHERE account='" .. accountID .. "'") if results then if ( mysql:num_rows(results) >= 1 ) then local x = 2350 local w = 0 for i=0, 4 do x = x+3 w = w+1 dbSel = mysql:fetch_assoc(results) table.insert(pedTable, w, createPed(dbSel['skin'], x, 532.7783203125, 1.796875)) peds = pedTable[w] setElementDimension(peds, 65000+playerid) setElementRotation(peds, 0,0,180) setElementData(peds, "skin"..i,dbSel['skin'], true) setElementData(peds, "charactername", dbSel['charactername'], true) setElementData(peds, "cked", dbSel['cked'], true) setElementData(peds, "lastarea", dbSel['lastarea'], true) setElementData(peds, "age", dbSel['age'], true) setElementData(peds, "faction_id", dbSel['faction_id'], true) setElementData(peds, "faction_rank", dbSel['faction_rank'], true) setElementData(peds, "lastlogin", dbSel['lastlogin'], true) addEventHandler("onPlayerClick",getRootElement(), function (button,state, element, posX, posY, posZ, abX, abY) if( state ~= "down" ) then if (getElementType(element) == "ped") then charName = getElementData(peds, "charactername", true) charSkin = getElementData(peds, "skin", true) charCKed = getElementData(peds, "cked", true) charArea = getElementData(peds, "lastarea", true) charAge = getElementData(peds, "age", true) charFaction = getElementData(peds, "faction_id", true) charRank = getElementData(peds, "faction_rank", true) charLogin = getElementData(peds, "lastlogin", true) outputDebugString("its a ped") triggerClientEvent("selectPedWin", getRootElement(), element, abX, abY, charName, charSkin, charCKed, charArea, charAge, charFaction, charRank, charLogin) else outputDebugString("its no ped") end end end ) end end end end addEvent("createPeds", true) addEventHandler("createPeds", getRootElement(), createPeds) Client Side: local windowsData = {} windowsData["pedName"] = {} windowsData["pedAge"] = {} windowsData["pedFaction"] = {} windowsData["pedFactionRank"] = {} windowsData["pedLastLogin"] = {} windowsData["pedArea"] = {} windowsData["pedPlayB"] = {} function selectPedWindow(element, abX, abY, charName, charSkin, charCKed, charArea, charAge, charFaction, charRank, charLogin) local x = abX - 75 local y = abY/4.5 local pedWin = guiCreateWindow(x, y,159,228,"",false) guiSetAlpha(pedWin,.70) guiWindowSetMovable(pedWin,false) guiWindowSetSizable(pedWin,false) guiSetVisible (pedWin, false) --skinPicture = guiCreateStaticImage(0.2956,0.114,0.4025,0.1711,"",true,pedWin) windowsData["pedName"][charName] = guiCreateLabel(0.1258,0.3158,0.6792,0.0614,"Name: "..tostring(charName).."",true,pedWin) windowsData["pedAge"][charName] = guiCreateLabel(0.1258,0.3904,0.6792,0.0702,"Age: "..tostring(charAge).."",true,pedWin) windowsData["pedFaction"][charName] = guiCreateLabel(0.1258,0.4561,0.6792,0.0614,"Faction:",true,pedWin) windowsData["pedFactionRank"][charName] = guiCreateLabel(0.1258,0.5219,0.6792,0.0614,"Faction Rank:",true,pedWin) windowsData["pedLastLogin"][charName] = guiCreateLabel(0.1258,0.6623,0.6792,0.0658,"Last Login:",true,pedWin) windowsData["pedArea"][charName] = guiCreateLabel(0.1258,0.5921,0.6792,0.0614,"Last Area:",true,pedWin) windowsData["pedPlayB"][charName] = guiCreateButton(0.2075,0.8158,0.5975,0.1404,"Play!",true,pedWin) if guiGetVisible ( pedWin ) then destroyElement(pedWin) outputDebugString("window destroyed") else guiSetVisible(pedWin, true) outputDebugString("window creating") end end addEvent("selectPedWin", true) addEventHandler("selectPedWin", getRootElement(), selectPedWindow) The same issue is happening as in the ScreenShot I posted. I just don't understand Does anyone have any idea how valhalla did it so I could possibly look at it as sort of a cheat sheet to try to complete this script.
  13. Yes how can I fix this?
  14. Sure, function selectPedWindow(element, abX, abY, charName, charSkin, charCKed, charArea, charAge, charFaction, charRank, charLogin) local x = abX - 75 local y = abY/4.5 local pedWin = guiCreateWindow(x, y,159,228,"",false) guiSetAlpha(pedWin,.70) guiWindowSetMovable(pedWin,false) guiWindowSetSizable(pedWin,false) guiSetVisible (pedWin, false) --skinPicture = guiCreateStaticImage(0.2956,0.114,0.4025,0.1711,"",true,pedWin) pedName = guiCreateLabel(0.1258,0.3158,0.6792,0.0614,"Name: "..tostring(charName).."",true,pedWin) pedAge = guiCreateLabel(0.1258,0.3904,0.6792,0.0702,"Age: "..tostring(charAge).."",true,pedWin) pedFaction = guiCreateLabel(0.1258,0.4561,0.6792,0.0614,"Faction:",true,pedWin) pedFactionRank = guiCreateLabel(0.1258,0.5219,0.6792,0.0614,"Faction Rank:",true,pedWin) pedLastLogin = guiCreateLabel(0.1258,0.6623,0.6792,0.0658,"Last Login:",true,pedWin) pedArea = guiCreateLabel(0.1258,0.5921,0.6792,0.0614,"Last Area:",true,pedWin) pedPlayB = guiCreateButton(0.2075,0.8158,0.5975,0.1404,"Play!",true,pedWin) if guiGetVisible ( pedWin ) then destroyElement(pedWin) outputDebugString("window destroyed") else guiSetVisible(pedWin, true) outputDebugString("window creating") end end addEvent("selectPedWin", true) addEventHandler("selectPedWin", getRootElement(), selectPedWindow)
  15. Yes I have and they all are correct and when it loops it will display in the debug the skin ID, the charactername, and the correct age.
  16. No, I'm sure that works or else the peds wouldn't have the correct skins. I think the issue is with the setElementData, like the element peds keeps getting overwritten if you know what I mean.
  17. Okay sorry I will try to explain it more clearly, So I am creating a character selection system where you click on the ped that represents the pedestrian you want to play as. (Sort of like valhalla's idea basically). Now when I use the script I created I get this.... See they all share the same name. That is a problem. In the mySQL database they have all different names and ages. However their skin ID's are correct. The name and age are only correct for the female on the right. Then what I was saying in later posts is if I only have the function loop once it gives the police officer with the correct name and age. I hope this helps your understanding of my dilemma.
  18. Is this too advanced for this forum?
  19. *note* when I edit the line until i == 5 To; until i == 2 It creates one ped with all the correct information. Any feedback is appreciated.
  20. bump come one guys there must be some one here who knows.
  21. function createPeds(client) local i = 1; -- character limit local accountID = getElementData(client, "gameaccountid") resultz = mysql:query("SELECT id, charactername, cked, lastarea, age, gender, faction_id, faction_rank, skin, DATEDIFF(NOW(), lastlogin) as llastlogin FROM characters WHERE account='" .. accountID .. "'") if resultz then addEventHandler("onPlayerClick",getRootElement(),pedSelInfo) playerid = getElementData(client, "playerid") if ( mysql:num_rows(resultz) >= 1 ) then local x = 2350 repeat i=i+1 -- this is for counting. x = x+3 dbSel = mysql:fetch_assoc(resultz) peds = createPed(dbSel['skin'], x, 532.7783203125, 1.796875) setElementDimension(peds, 65000+playerid) setElementRotation(peds, 0,0,180) setElementData(peds, "skin",dbSel['skin'], true) setElementData(peds, "charactername", dbSel['charactername'], true) setElementData(peds, "cked", dbSel['cked'], true) setElementData(peds, "lastarea", dbSel['lastarea'], true) setElementData(peds, "age", dbSel['age'], true) setElementData(peds, "faction_id", dbSel['faction_id'], true) setElementData(peds, "faction_rank", dbSel['faction_rank'], true) setElementData(peds, "lastlogin", dbSel['lastlogin'], true) outputDebugString(dbSel['skin']) outputDebugString("Looper2 called!") until i == 5 else end end end I think the issue is when it loops it overwrites the previous loops data input. How can I set a unique key for each with every loop the function makes? example; first look it saves setElementData(peds, "skin",dbSel['skin'], true) the next loop would save under setElementData(peds, "skin2",dbSel['skin'], true) or something along those lines. If anyone oculd help me I would deeply appreciate it!
  22. Yeah, I don't understand either...I got as far as creating my other chatbox but idk how to add the chat into the box...
  23. Hey everyone I was just wondering how I can get the distance from an object model, for example a safe. What functions could I use to determine where it is for the getDistanceBetween3d function. example: x,y,z = getElementPosition(getLocalPlayer()) wx,wy,wz = (idk what goes here) local dis = getDistanceBetweenPoints3D(x,y,z,wx,wy,wz) if dis >5 then outputChatbox("your not near a safe") else outputChatBox ("you ARE near a safe") Can someone help me out here?
×
×
  • Create New...