Jump to content

LabiVila

Members
  • Posts

    272
  • Joined

  • Last visited

Everything posted by LabiVila

  1. There is a resource I've made a while ago; https://community.multitheftauto.com/in ... s&id=11477 it's exactly what you're looking for
  2. LabiVila

    Help

    Another way is creating a gui edit, then set it's alpha to 0, create a rectangle there and it'll look like you are writing in a 'dx edit'
  3. You can using this function: https://wiki.multitheftauto.com/wiki/GetWaterLevel, and try to do it yourself before asking for full script (as you did 2-3 previous times)
  4. do a: local x,y = guiGetScreenSize () then if your resolution is 1024x768 you do this: 217/1024 = 0.2119140625 79/768 = 0.1028645833333333 647/1024 = 0.6318359375 558/768 = 0.7265625 after you get it done, you go like this: guiCreateStaticImage (x*0.2119140625, y*0.102864583, x*0.6318359375, y*0.7265625, "panel.png", false) you can keep as much decimal numbers as you want, but the more the numbers the better
  5. LabiVila

    Help me !

    There are already quite a few topics same as this one, /viewtopic.php?f=108&t=56127 , /viewtopic.php?f=108&t=45087 , /viewtopic.php?f=91&t=52295 I hope it helps
  6. The 'content' is very messed up, what is it supposed to appear? You better rewrite that script in your own way, that's most likely copied
  7. LabiVila

    need help

    You can't, you need a full scripted gamemode for that. The resource Perfect gave to you just replaces three objects of MTA with some edited models (that's made for ffsgaming, as it just released a carball arena), that doesn't have to do with what you're looking for. As for the ball, you have to edit an object's model (as there are some balls already but some small ones that doesn't help you at all) then just math
  8. buttons = {} edits = {} addEventHandler("onClientResourceStart",resourceRoot, function() screenW, screenH = guiGetScreenSize() loginWindow = guiCreateWindow((screenW - 628) / 2, (screenH - 608) / 2, 628, 608, "COG Cops 'n' Robbers / Turfing / Civilians", false) guiWindowSetSizable(loginWindow, false) guiSetAlpha(loginWindow, 1.00) GUIEditor.label[1] = guiCreateLabel(0, 32, 119, 44, "Username:", false, loginWindow) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") edits["UserEdit"] = guiCreateEdit(119, 31, 178, 45, "", false, loginWindow) GUIEditor.label[2] = guiCreateLabel(0, 92, 119, 44, "Password:", false, loginWindow) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") edits["PassEdit"] = guiCreateEdit(119, 92, 178, 45, "", false, loginWindow) guiEditSetMasked("PassEdit", true) rememberUsername = guiCreateCheckBox(346, 47, 15, 15, "", false, false, loginWindow) rememberPass = guiCreateCheckBox(346, 107, 15, 16, "", false, false, loginWindow) GUIEditor.label[3] = guiCreateLabel(396, 47, 139, 15, "Remember Username", false, loginWindow) GUIEditor.label[4] = guiCreateLabel(396, 107, 139, 15, "Remember Password", false, loginWindow) buttons["login"] = guiCreateButton(10, 185, 173, 50, "Login", false, loginWindow) guiSetProperty(loginButton, "NormalTextColour", "FFFFFEFE") buttons["register"] = guiCreateButton(229, 185, 173, 50, "Create Account", false, loginWindow) guiSetProperty("register", "NormalTextColour", "FFFFFEFE") buttons["forgotPass"] = guiCreateButton(445, 185, 173, 50, "Forgot Password?", false, loginWindow) guiSetProperty("forgotPass", "NormalTextColour", "FFFFFEFE") GUIEditor.label[5] = guiCreateLabel(0, 267, 628, 64, "Cheating or Scamming will result in a 5 years ban.", false, loginWindow) guiSetFont(GUIEditor.label[5], "clear-normal") guiLabelSetColor(GUIEditor.label[5], 41, 205, 229) guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[5], "center") GUIEditor.tabpanel[1] = guiCreateTabPanel(12, 322, 606, 276, false, loginWindow) GUIEditor.tab[1] = guiCreateTab("Server Updates", GUIEditor.tabpanel[1]) updatesInfo = guiCreateGridList(0, 0, 606, 252, false, GUIEditor.tab[1]) guiGridListAddColumn(updatesInfo, "Date", 0.3) guiGridListAddColumn(updatesInfo, "Author", 0.3) guiGridListAddColumn(updatesInfo, "Description", 0.3) for i = 1, 2 do guiGridListAddRow(updatesInfo) end guiGridListSetItemText(updatesInfo, 0, 1, "24/07/2015", false, false) guiGridListSetItemText(updatesInfo, 0, 2, "Simple01", false, false) guiGridListSetItemText(updatesInfo, 0, 3, "Creation of the gamemode.", false, false) guiGridListSetItemText(updatesInfo, 1, 1, "-", false, false) guiGridListSetItemText(updatesInfo, 1, 2, "-", false, false) guiGridListSetItemText(updatesInfo, 1, 3, "-", false, false) GUIEditor.gridlist[1] = guiCreateGridList(0, 0, 606, 252, false, GUIEditor.tab[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Date", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "Author", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "Description", 0.3) for i = 1, 2 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "24/07/2015", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "Simple01", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "Creation of the gamemode.", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "-", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "-", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 3, "-", false, false) end ) There you go but I have the feeling this isn't made by you. You haven't copied the whole script it seems
  9. The problem isn't at timer then, can you post all the script you have and show us what debugscript says?
  10. setTimer ( function () theLocator () end, 0, 0 )
  11. function asking (source, cmd, target) local target = getPlayerFromName (target) outputChatBox ("* "..getPlayerName (source).." has asked you for a kiss, /confirm or /ignore it.", target, 255, 255, 255) addCommandHandler ("confirm", function (player) if (player == target) then outputChatBox ("* "..getPlayerName (target).." has accepted your kissing offer.", source, 255, 255, 255) --do animations here end end ) end addCommandHandler ("kiss", asking) just replace animations and fix any possible bug
  12. No it doesn't help it, the message still goes to one of two alive players (but just after 5 seconds now), any other way you suggest?
  13. Can you explain a bit better? So how do you want it to work? Because that code isn't so easy to understand. If you write /kiss targetPlayer then targetPlayer has to /confirmK right? And if he does /confirmK then animations happen?
  14. https://wiki.multitheftauto.com/wiki/CreateColSphere it can be done via this
  15. It won't be very useful as you can't determine the time the player dies. Is there any other way I can do it? I can erase the whole script if needed
  16. Yea should've placed the event tho; addEventHandler ("onPlayerWasted", getRootElement(), who) and it's not triggered anyhow. I've also got this; function onLogin () local account = getPlayerAccount (source) if account then local points = getAccountData (account, "DMpoints") outputChatBox ("Your statistics have been loaded successfully."..points) end end addEventHandler ("onPlayerLogin", getRootElement(), onLogin) it saves the points, nothing else
  17. outputChatBox ("#ffff00H#ff0000P", sourcePlayer, 255, 255, 255, true) this would do a yellow H and a red P
  18. local all = getAlivePlayers () if (#all == 1) then local player1 = all[1] local p1Account = getPlayerAccount (player1) if p1Account and not isGuestAccount (p1Account) then local points = points + everyone outputChatBox ("You got "..points.." points for finishing first.", player1, 255, 255, 255) setAccountData (p1Account, "DMpoints", getAccountData (p1Account, "DMpoints") + points) else outputChatBox ("You are not logged in.", player1, 255, 255, 255) end end if (#all == 2) then local player2 = all[2] local p2Account = getPlayerAccount (player2) if p2Account and not isGuestAccount (p2Account) then local points = points + everyone - 1 outputChatBox ("You got "..points.." points for finishing second.", player2, 255, 255, 255) setAccountData (p2Account, "DMpoints", getAccountData (p2Account, "DMpoints") + points) else outputChatBox ("You are not logged in.", player2, 255, 255, 255) end end Hey, thanks for taking time. So I recently got stuck in a problem, everything works fine but the outputchatBoxs. outputChatBox ("You got "..points.." points for finishing second.", player2, 255, 255, 255) - this outputs in the wrong time, it outputs when two players are alive, not when second players is dead. I want it like when player 2 dies, it outputs him the message, not when player 3 dies and two are alive, it outputs a random player between the two alive ones. Thanks
  19. LabiVila

    help

    Have you used guiGetScreenSize?
  20. local x,y = guiGetScreenSize () local px = y * 1.02 local py = y * 0.725 local h = y * 0.225 addEventHandler ("onClientRender", root, function (source) local pVehicle = getPedOccupiedVehicle (localPlayer) if pVehicle then local vHealth = (getElementHealth (pVehicle)-250)/10 if vHealth < 5 then dxDrawImage(px, py, h, h, "img_radar.png", 0, 0, 0, tocolor (255, 0, 0, 255)) elseif vHealth < 0 then vHealth = 0 end dxDrawText (vHealth, x/3, y/3, x, y, tocolor (255, 255, 255)) local exVHealth = 255 - vHealth*3+25 if exVHealth < 0 then exVHealth = 0 end dxDrawImage(px, py, h, h, "img_radar.png", 0, 0, 0, tocolor (0+exVHealth, 1*vHealth*3+25, 0, 255)) end end ) Hey, it works fine but after the color is full red (car's HP is 0), if I keep hitting objects, the color will start getting green... how can I prevent this?
  21. One line before 26 write this (at line 25): removeEventHandler ("onClientRender", root, create) this will remove the warning
×
×
  • Create New...