Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 31/07/19 in all areas

  1. 1 point
  2. Natively the only solution and not very smart as you'd have a server full of custom models. You could fill a custom car with custom wheel components, then extract those and add them as replacements for existing vehicles. Sort of like an in-game model library with infinite ID's.
    1 point
  3. You can change stock rims of a vehicle only by replacing it's model if I am not wrong.
    1 point
  4. oldText = ( ( oldText ) .. "[" .. ( tostring ( hours ) ) .. "-" .. ( tostring ( minute ) ) .. "-" .. ( tostring ( second ) ) .. "]" .. ( getPlayerName ( localPlayer ) ) .. ": " .. ( newText ) )
    1 point
  5. Na linha 25 coloca o "p" de pdx em letra maiúscula.
    1 point
  6. local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) local glock = createMarker(297.947, -80.809, 1000.600, "cylinder", 1, 255, 0, 0, 40) setElementInterior(glock, 4) function Pdx () -----Painel dxDrawLine(333 - 1, 194 - 1, 333 - 1, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 194 - 1, 333 - 1, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(333 - 1, 574, 691, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 574, 691, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawRectangle((screenW - 358) / 2, (screenH - 380) / 2, 358, 380, tocolor(0, 0, 0, 138), false) dxDrawImage(333, 194, 358, 380, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(254, 254, 254, 50), false) dxDrawImage(417, 257, 202, 160, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(333, 194, 358, 53, tocolor(21, 133, 6, 111), false) dxDrawRectangle(359, 468, 310, 80, tocolor(21, 133, 6, 111), false) dxDrawText("R$15.000", 346, 417, 681, 463, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Glock-18", 338, 203, 681, 237, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("comprar", 372, 481, 659, 538, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) end function render(hitPlayer, matchingdimension) if (hitPlayer == localPlayer) then addEventHandler("onClientRender", root, Pdx) render = true showCursor(true) end end addEventHandler ("onClientMarkerHit", glock, render) function abrir (_,state) -------Render do Painel if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelglock", true) addEventHandler("painelglock", root , abrir) function isCursorOnElement(x,y,w,h) ------Cursor local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function arma (_,state) if painel == true then if state == "down" then if isCursorOnElement(372, 481, 659, 538) then triggerServerEvent ("glock", localPlayer) end end end end addEventHandler ("onClientClick", root, arma) Para mim funcionou, qual o seu problema no debugscript? Edit: https://imgur.com/a/opRPMbu ficou assim.
    1 point
  7. function render(hitPlayer, matchingDimension) if (hitPlayer == localPlayer) then addEventHandler("onClientRender", root, Pdx) ----Erro render = true showCursor (true) end end addEventHandler("onClientMarkerHit", glock, render) Assim deverá funcionar
    1 point
  8. local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) local glock = createMarker(297.947, -80.809, 1000.600, "cylinder", 1, 255, 0, 0, 40) setElementInterior(glock, 4) function Pdx () -----Painel dxDrawLine(333 - 1, 194 - 1, 333 - 1, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 194 - 1, 333 - 1, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(333 - 1, 574, 691, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine(691, 574, 691, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawRectangle((screenW - 358) / 2, (screenH - 380) / 2, 358, 380, tocolor(0, 0, 0, 138), false) dxDrawImage(333, 194, 358, 380, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(254, 254, 254, 50), false) dxDrawImage(417, 257, 202, 160, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(333, 194, 358, 53, tocolor(21, 133, 6, 111), false) dxDrawRectangle(359, 468, 310, 80, tocolor(21, 133, 6, 111), false) dxDrawText("R$15.000", 346, 417, 681, 463, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("Glock-18", 338, 203, 681, 237, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText("comprar", 372, 481, 659, 538, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) end function render(hitPlayer, matchingdimension) if (hitPlayer == localPlayer) then addEventHandler("onClientRender", root, Pdx) render = true showCursor(true) end end addEventHandler ("onClientMarkerHit", glock, render) function abrir (_,state) -------Render do Painel if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelglock", true) addEventHandler("painelglock", root , abrir) function isCursorOnElement(x,y,w,h) ------Cursor local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function arma (_,state) if painel == true then if state == "down" then if isCursorOnElement(372, 481, 659, 538) then triggerServerEvent ("glock", localPlayer) end end end end addEventHandler ("onClientClick", root, arma) Se isso não funcionar, remova da linha 31 a 43 e tente denovo.
    1 point
  9. local vehDB = dbConnect("sqlite", "vehicle.db") dbExec(vehDB, "CREATE TABLE IF NOT EXISTS vehicle_base (pAcc TEXT, vehicleID TEXT, vehicleName TEXT, vehiclePrice TEXT, vehicleStatus TEXT, vehicleHP TEXT)") function dateGetV() local accName = getAccountName(getPlayerAccount(source)) local qh = dbQuery(vehDB, "SELECT * FROM vehicle_base WHERE vehicleID=? AND pAcc=?", "520", accName) local result = dbPoll(qh, -1) if result then for _, row in ipairs(result) do outputDebugString(row["vehicleHP"]) end end end addEvent("dategetV", true) addEventHandler("dategetV", root, dateGetV) I'd do like this.
    1 point
  10. save the player serial in a table instead of element datas table[serial] = true table[serial] = nil
    1 point
  11. Oui t'as raison, je vérifierai mais je pense qu'on peut.
    1 point
  12. Ok, ainda acho estranho você me dizer que fez até aqui sozinho e não saber fazer uma coisa tão simples. Aqui está: Client local screenW, screenH = guiGetScreenSize () local resW, resH = 358, 380 local x, y = (screenW/resW), (screenH/resH) local markerWeapons = createMarker (x, y, z, "cylinder", 1.0, 255, 255, 255, 255) -- Coloque as coordenadas do seu marker aqui onde tem x, y, z. function Pdx () dxDrawLine (333 - 1, 194 - 1, 333 - 1, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine (691, 194 - 1, 333 - 1, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawLine (333 - 1, 574, 691, 574, tocolor(38, 237, 11, 254), 1, false) dxDrawLine (691, 574, 691, 194 - 1, tocolor(38, 237, 11, 254), 1, false) dxDrawRectangle ((screenW - 358) / 2, (screenH - 380) / 2, 358, 380, tocolor(0, 0, 0, 138), false) dxDrawImage (333, 194, 358, 380, ":GUI/images/examples/new_city_sfundo.png", 0, 0, 0, tocolor(254, 254, 254, 50), false) dxDrawImage (417, 257, 202, 160, ":GUI/images/examples/G-18.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle (333, 194, 358, 53, tocolor(21, 133, 6, 111), false) dxDrawRectangle (359, 468, 310, 80, tocolor(21, 133, 6, 111), false) dxDrawText ("R$15.000", 346, 417, 681, 463, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText ("Glock-18", 338, 203, 681, 237, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) dxDrawText ("comprar", 372, 481, 659, 538, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "center", false, false, false, false, false) end addEventHandler ("onClientMarkerHit", markerWeapons, function (hitElement, matchingDimension) if (getElementType (hitElement) == "player") then abrir () end end) function abrir (_, state) if painel == false then showCursor (true) addEventHandler ("onClientRender", root, Pdx) painel = true else showCursor (false) removeEventHandler ("onClientRender", root, Pdx) painel = false end end addEvent ("painelglock", true) addEventHandler ("painelglock", root , abrir) --[[ -- Não entendi necessidade disso aqui, deixei comentado. function togglePanel () if getElementData (localPlayer, nomeDaACL_Comandante) then if not isEventHandlerAdded ("onClientRender", root, onClientRender) then guiGridListClear (playerList) for id, player in ipairs(getElementsByType("player")) do guiGridListSetItemText (playerList, guiGridListAddRow(playerList), 1, getPlayerName(player):gsub('#%x%x%x%x%x%x', ''), false, false) end guiSetVisible (playerList, true) guiSetVisible (edit, true) aVisible = true rVisible = true addEventHandler ("onClientRender", root, onClientRender) showCursor (true) else guiSetVisible (playerList, false) guiSetVisible (edit, false) removeEventHandler ("onClientRender", root, onClientRender) showCursor (false) end end end --]] function isCursorOnElement (x, y, w, h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize () cursorx,cursory = mx * fullx, my * fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function arma (_, state) if painel == true then if state == "down" then if isCursorOnElement (372, 481, 659, 538) then triggerServerEvent ("glock", localPlayer) end end end end addEventHandler ("onClientClick", root, arma) Server function arma () giveWeapon (source, 22, 300, true) outputChatBox ("( #ff0000INFO#ffffff ) #ffff00Você comprou #00ff00Glock-18 !", source, 255, 255, 255, true) end addEvent ("glock",true) addEventHandler ("glock", root, arma) OBS: Não testado, vale lembrar que é bom sempre você indentar o código, assim fica mais fácil de você entender e o código fica mais organizado.
    1 point
  13. onClientMarkerHit addEventHandler onClientRender showCursor @wilborn
    1 point
  14. J'avais pas répondu tout de suite car comme Wumbaloo je ne l'avais jamais utilisé et du coup je n'ai jamais cherché à comprendre son fonctionnement. Mais grâce au post de 50p proposé par Wumbaloo (omg 2014 !), j'ai enfin capté. Et c'est pour ça que je viens juste corriger la manière de traduire "0x1001800": Il faut plutôt dire (sachant que ça se lit de droite à gauche): il y a la valeur 8 pour le 3ème byte donc WHEEL_F_WIDE2 est activé la valeur 1 pour le 4ème byte donc WHEEL_R_NARROW2 est activé la valeur 1 pour le 7ème byte donc USE_MAXSP_LIMIT est activé Précision aussi, on peut remarquer que dans notre exemple de 0x1001800, on n'a que 7 bytes de renseignés alors que le handlingFlags est sur 8 bytes. C'est parce que 0x1001800 c'est pareil que 0x01001800 (qui est bien sur 8 bytes) ou même pareil que 0x000000001001800. En gros tant que t'as des 0 sur la gauche du dernier "vrai chiffre" (je rappelle, ça se lit de droite à gauche) tu peux les supprimer sans problème. C'est comme si je disais 0050 pommes == 50 pommes. En vrai si ça peut aider je me suis dit que je pourrais faire un excel sur google drive où on viendrait cocher les flags souhaités et ça te sortirai le flag final en hexa (0xBidule) dans une case de résultat. Si j'ai au minimum 1 seule personne intéressée, je le fais volontiers ^^
    1 point
  15. Juste pour info évite de coller des milliers de lignes de codes ici. Perso chez moi ça me fait crasher Chrome sur mon téléphone et ça l'a bien fait freeze avant de me redonner la main sur mon pc. Pour ton problème je suis d'accord avec Wumbaloo, il faut ajouter une condition avant d'exécuter le trigger de l'event onPlayerUseMedicObject et qui doit certainement être dans le code client de l'inventaire. Un petit boolean isHealing ou isUsingMedic que tu initialises à false au démarrage du script. Puis lorsque que le joueur a fait l'action en choisissant son heal, tu vérifies si le boolean est toujours à false, si c'est le cas tu fais le trigger de onPlayerUseMedicObject, tu passes le boolean à true et également un setTimer de 1500 ms pour le remettre à false. Et si ce n'est pas le cas (le boolean est à true) c'est qu'il y a déjà une action de heal en cours donc tu ne fais rien (tu ne fais pas -1 sur son item utilisé et tu ne fais pas le trigger de onPlayerUseMedicObject).
    1 point
  16. Erros de IF/indentação corrigido, agora o resto é com você, Jogador não esta declarado em nenhum local. addCommandHandler ("verarmas", function (player, cmd, id) if getElementData (player, "AirNewSCR_Policial1") == "Sim" then local id = getElementData (player, "ID") == id then if id then outputChatBox ("* Armas do cidadão "..getPlayerName(Jogador).."!", player, 255, 255, 255, true) for slot = 0, 12 do local Armas = getPedWeapon (Jogador, slot) local Municao = getPedTotalAmmo (Jogador, slot) if Armas > 0 then if Municao > 0 then weapon_nome = getWeaponNameFromID (Armas) outputChatBox ("* "..weapon_nome.." #3a3a3a»#25e014 "..Municao.." Bala(s)!", player, 255, 255, 255, true) end end end else outputChatBox ("* Erro: Jogador não encontrado!", player) end end end) Nem testei seu código, mas acredito que não esteja funcionando praticamente nada. E seja mais agradecido com quem te ajuda, deixando like nos comentários do pessoal
    1 point
  17. Multi Theft Auto: San Andreas 1.5.6 is released Today the MTA team is delighted to announce the release of MTA:SA 1.5.6. You will receive an automatic update soon, but if you don't have MTA installed, you can get it from the home page . There are many changes and improvements across the board, but one feature stands out as being especially exciting: custom animations! This has been a feature on our radar for many years, and @Saml1er was the one who decided to make what many have considered a dream, a reality. Take a quick look at this video of custom animations in action to get a glimpse of what's possible: Changes This release includes many additions, improvements, and fixes. Find the complete set of changes, and more information about the improvements listed below, in the 1.5.6 release notes. If you'd like to keep on top of all the things we're working on, why not watch or star our GitHub repository? Here is a heavily cut-down selection of features and fixes. Highlights: New features Ordered roughly by reverse chronological order New languages Bulgarian, Indonesian and Chinese (Traditional) (a3217) New server console feature for arrow command history (#274 by myonlake) New ACL property ModifyOtherObjects.resourceName for one resource only (6614d) New element functions getElementAngularVelocity, setElementAngularVelocity (#73 by lex128) New chat function clearChatBox (#215 by CrosRoad95) New vehicle functions getVehicleRespawnPosition, getVehicleRespawnRotation, setVehicleRespawnRotation (#334, #338 by l0nger) New goggle effect parameter "noiseEnabled" parameter to setCameraGoggleEffect (#324 by samr46) New drawing function dxDrawCircle (#266 by CrosRoad95, Saml1er) New jetpack functions setPedWearingJetpack, isPedWearingJetpack (#243 by Dezash) New element function getElementsWithinRange (de149) New GUI functions guiWindowIsMovable, guiWindowIsSizable, guiEditGetMaxLength, guiEditIsMasked (#272, #255 by FileEX) New fire function extinguishFire (#207 by CrosRoad95, #252 by myonlake, also 7838b) New world functions getPedsLODDistance, setPedsLODDistance, resetPedsLODDistance (#231 by CrosRoad95) New GUI scrollbar functions guiMemoSetVerticalScrollPosition, guiMemoGetVerticalScrollPosition (#248 by myonlake) New GUI functions guiMemoIsReadOnly, guiEditIsReadOnly (#236 by FileEx) New special property "underworldwarp" (#208 by CrosRoad95, #222 by myonlake) New vector support for collision functions (#217 by myonlake, #163 by Pawelo / 4O4) New animations functions setPedAnimationSpeed, engineLoadIFP, engineReplaceAnimation (Saml1er, with some help from Icensow, raw data loading courtesy of #247 by samr46) New colshape function isInsideColShape (#195 by tederis) New vehicle function for client-sided setVehicleHandling (#192 by Renkon) New world sound parameter to setWorldSoundEnabled to stop sound immediately (44844) New ped weapon function isPedReloadingWeapon (#149 by Neproify) New debug hooks pre/postEventFunction added to addDebugHook (#126) New event parameter "deleted" add to onResourceStop (98502) New vehicle function isVehicleWheelOnGround (#146 by ZReC) New command reloadacl (#131 by Timic) Enable switching camera view mode for trains (#125 by ZReC) New encode functions encodeString, decodeString (#184 by SDraw) New pickup events onPickupLeave & onPlayerPickupLeave (#176 by emre1702) New account functions getAccountIP, getAccountsByIP, getAccountsByData & setAccountName (#164 by emre1702) Highlights: Bug fixes and tweaks getChatboxLayout now works as advertised (#254 by myonlake) Return 2 vectors for ele:getBoundingBox (#305 by Pirulax, #332 by Addlibs) Fix inconsistencies in reading userdata in Player functions (#308 by Addlibs) Improve debug info for garbage collected files (#312 by Dezash) Fix crashes with account functions when using empty strings (faa57) Missing bShallow for server-side water (#240 by myonlake) Fix spawnPlayer rotation not working properly (#258 by myonlake) Fix false elements in getElementsWithinRange (#300 by Sergeanur) Removal of the /whowas command (0cffa) Improve connect to disconnect you less frequently (7fc29) Make connect port argument default to 22003 (d698b) Fix many bugs related to animations, jetpack and choking (#229 by myonlake) getVehicleType not being consistent server/client side (b08f3) Fix custom CEGUI skins accidentally breaking dxDrawRectangle (4e57a) Ignore colorcodes while tabbing in chatbox (#238 by Timic) Various bind tweaks, please tell us if something is broken (by emre1702) Fix empty string in getVehicleNameFromModel (instead of false) (#219 by emre1702) Weather blending improvements (#204 by emre1702) Fix 'stream_title' meta tag when the playback is started (#206 by Sergeanur) Fix problems when using a controller with more than 7 axes (382a3) Console no longer displays an error message when pressing the key of a disabled MTA control (23dad) Fix crash caused by calling client-side setPlayerNametagShowing with a ped (554a2) Fix server crash on server-window resize (becf0) Download This release is backwards compatible with the older 1.5.x releases (1.5.5, 1.5.4, all the way to 1.5). However, if you would like to take advantage of all of these useful changes, you will need to go and download the update! Servers: binaries are available, and don't forget to update your default resources. What's next? We're continually working on new features and fixes for MTA. If you're happy to report bugs and crashes do try out our Nightly release stream. You can do this by going into Settings -> Advanced -> Auto updater -> Update build type. Change to "nightly" and hit "Check for update now". Only do this if you like crashing and like filling out bug reports. We're also working on a brand new community: we want your suggestions, ideas and feedback! If you have any questions or would just like to chat with the community, do check out our official Discord server. We have channels for scripting, general support (bugs), mod development, and many more! Thank you! Thank you very much to the following community members for their work towards this release: Addlibs, ArranTuna, CrosRoad95, Dezash, Dutchman101, Einheit-101, emre1702, FileEX, forkerer, Icensow, jlillis, l0nger, lex128, lopezloo, MIKI785, myonlake, Neproify, Pawelo / 4O4, Pirulax, Renkon, samr46, SDraw, Sergeanur, tederis, Timic3, ZReC, and many others who helped document on the wiki, reported bugs, and helped out with issues. (If your name is missing or you want to change your entry above, please PM @qaisjp) You could be on this list! We're always on the lookout for new contributors. Contribute on GitHub, and chat with us on Discord. Finally, everyone, please give a ? to the newest maintainer of Multi Theft Auto: @Saml1er. Until next time, The MTA Team
    1 point
  18. http://c141051.try.invisionpower.com/ واو واو واو , اتعب على نفسك شوي واشتر موقع واستضافه وابدء
    0 points
×
×
  • Create New...