Jump to content

Mann56

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by Mann56

  1. Mann56

    PM system

    Dude the trigger server event has 4 args? Edit : Dude ain't working here's my code: Client: local pmWindow = guiCreateWindow(498, 143, 353, 549, "", false) gridThing = guiCreateGridList(12, 29, 331, 468, false, pmWindow) column = guiGridListAddColumn(gridThing, "Name", 0.9) editBox = guiCreateEdit(15, 510, 291, 29, "", false, pmWindow) closeButton = guiCreateButton(315, 509, 28, 30, "Send", false, pmWindow) guiSetProperty(closeButton, "NormalTextColour", "FFAAAAAA") guiSetVisible(pmWindow, false) showCursor(false) local pmEnabled = false function dxText () if not pmEnabled then return end dxDrawText("PM Box", 454, 69, 903, 134, tocolor(213, 216, 14, 255), 1.00, "bankgothic", "center", "center", false, false, true, false, false) end addEventHandler("onClientRender", root, dxText) function togglePM () pmEnabled = not pmEnabled guiSetVisible(pmWindow, pmEnabled) showCursor(pmEnabled) end bindKey("F3","up", togglePM) function showDxText() addEventHandler("onClientRender", root, function() dxDrawText("PM Box", 454, 69, 903, 134, tocolor(213, 216, 14, 255), 1.00, "bankgothic", "center", "center", false, false, true, false, false) end ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), function () for i,v in pairs(getElementsByType("player")) do row = guiGridListAddRow(gridThing) guiGridListSetItemText ( gridThing, row, column, getPlayerName ( v ), false, false ) end end ) function SendMessage () pmer = localPlayer local row,column = guiGridListGetSelectedItem (gridThing) if row == -1 then return end if row and column and row >=0 and column >=0 then local playerName = guiGridListGetItemText(gridThing,row,colmun) local player = getPlayerFromName(playerName) if player then local text = guiGetText(editBox) if text then triggerServerEvent( "onPlayerSendPM", localPlayer,text, player) guiSetText (editBox, "" ) end end end end addEventHandler("onClientGuiClick",closeButton,SendMessage) Server addEvent("onPlayerSendPm",true) addEventHandler("onPlayerSendPm",resourceRoot, function (text,player,) outputChatBox("[PM] -> "..player.." : "..text.."",client,255,255,0) outputChatBox("[PM] -> "..pmer.." : "..text.."",player,255,255,0) end )
  2. Mann56

    PM system

    Thanks the functions were a bit complicated by names and so i must trigger sver event?
  3. Dude i cannot get you what do you want ? If you want the aim bodypart use the optional argument if not please specify your question
  4. Mann56

    PM system

    Hey there, I need some help i have created a gridlist which gets all player names but i can't figure out how to send the selected player the message . I used the following function. pmer = localPlayer selectedPlayer = guiGridListGetSelectedItem(gridThing) guiSetInputEnabled(true) pmto = getPlayerFromName(selectedPlayer) text = guiGetText(editBox) outputChatBox("[PM] -> "..selectedPlayer.." : "..text.."",localPlayer,255,255,0) outputChatBox("[PM] -> "..pmer.." : "..text.."",selectedPlayer,255,255,0) As i am alone on my local i exactly dont know will it work but is the function guiGridListGetSelectedItem ok? As there is no related function other than this. I would look for some help.... Thanks...
  5. Lol dude you need to go through the wiki. Just use this command or if you have edit it. And just go to the place where you want the spawnpoint and get the x,y and z using the admin panel and put them there
  6. Ever heard of 'Optional arguments' ? Dude he means there is no tocolor argument
  7. Mann56

    Help Bindkey

    Thank you very much . They should have it as an optional argument in bindKey so that it can be turned off without any trouble
  8. Mann56

    Help Bindkey

    Hey there i was making a PM System (it's still incomplete so the code may be broken somewhere) I had a problem that when i press f3 which is bindkey it spawns but when i again press bindkey instead of not showing another gui appears Please help: GUIEditor = { gridlist = {}, button = {}, edit = {} } function pmGUI() pmWindow = guiCreateWindow(498, 143, 353, 549, "", false) guiWindowSetSizable(pmWindow, false) gridThing = guiCreateGridList(12, 29, 331, 468, false, pmWindow) column = guiGridListAddColumn(gridThing, "Name", 0.9) editBox = guiCreateEdit(15, 510, 291, 29, "", false, pmWindow) closeButton = guiCreateButton(315, 509, 28, 30, "X", false, pmWindow) guiSetProperty(closeButton, "NormalTextColour", "FFAAAAAA") guiSetVisible(pmWindow,true) showCursor(true) end function showDxText() addEventHandler("onClientRender", root, function() dxDrawText("PM Box", 454, 69, 903, 134, tocolor(213, 216, 14, 255), 1.00, "bankgothic", "center", "center", false, false, true, false, false) end ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), function () for i,v in pairs(getElementsByType("player")) do row = guiGridListAddRow(gridThing) guiGridListSetItemText ( gridThing, row, column, getPlayerName ( v ), false, false ) end end ) bindKey("F3","up",pmGUI) bindKey("F3","up",showDxText) PS: Please do not complete the other code i want to do it myself
  9. Maybe this is a part of his code? Post your full code
  10. Mann56

    [WIP] Mask Shop

    Good work dude they are really nice models
  11. 600000 milliseconds = 600 seconds = 10 minutes
  12. It's good you are working on something which has so many bugs . Hope that people will receive bug free version at last. I would have helped you but am also not quite good at gui and dx (Just started learning that sometime before) but if you want you can contact me
  13. Mann56

    DxDrawText

    Not working in 800 * 600 *32 :c
  14. Mann56

    DxDrawText

    I changed the resolution to 800 * 600 * 32 but i dont see the speedometer EDIT : i see it in 1360 * 600 * 32
  15. Mann56

    DxDrawText

    dude how does that work?
  16. Mann56

    DxDrawText

    i used that -> local x,y = guiGetScreenSize () SO now should i set it to x- (1360-1080),y - (768-700) ?
  17. Mann56

    DxDrawText

    1360 * 768 * 32 and i changed the thing again -> speedx,speedy,speedz = getElementVelocity(getPedOccupiedVehicle(localPlayer)) kmh = math.floor(((speedx^2 + speedy^2 + speedz^2) ^ (0.5)) * 180) dxDrawText (""..tostring(kmh).." km/h" , 1080,700,x,y,tocolor(255,255,0,255),2,"pricedown") end Thank you for helping
  18. Mann56

    DxDrawText

    Nvm above thing i found how to sort it out i did this -> speedx,speedy,speedz = getElementVelocity(getPedOccupiedVehicle(localPlayer)) kmh = math.floor(((speedx^2 + speedy^2 + speedz^2) ^ (0.5)) * 180) dxDrawText (""..tostring(kmh).."km/h" , 1050,700,x,y,tocolor(255,255,255,255),2,"bankgothic") end Now, how can i make it general for all resolutions?
  19. Mann56

    DxDrawText

    Hey guys! I have been working on a hud where i am going to use dxtext for the first time. I saw the wiki but i have no idea how to get those absolute x and absolute y position where i want the text. Can someone help me? Thanks...
  20. No not this way where you have your code where the player spawns add it there don't make an individual resource
  21. So you want the health to be 250?
  22. Oke so ipairs ignores alphabetical indexing while pairs does both.. Thanks <3
×
×
  • Create New...