Jump to content

Absence2

Members
  • Posts

    267
  • Joined

  • Last visited

Everything posted by Absence2

  1. Absence2

    Some help

    function manUp () setWeaponProperty(30, "pro", "damage", 999) end addCommandHandler ( 'hitman', manUp )
  2. Absence2

    GUI Advanced

    lol, adding GUIs with guieditor wont solve anything viewtopic.php?f=108&t=27571&p=309989#p309989 https://community.multitheftauto.com/index.php?p=resources
  3. show serverside code please
  4. guiGetVisible guiSetVisible
  5. I posted clientside on page #1 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In" true, wdwLogin) line 39, missed comma, 'end' on line 76
  6. use /debugscript 3, syntax errors. gui.lua function createLoginWindow() -- define the X and Y positions of the window local X = 0.375 local Y = 0.375 -- define the width and height of the window local Width = 0.25 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" -- click on the function's name to read its documentation. wdwLogin = guiCreateWindow(x, y, Width, Height, "Please login with your username and password", true) -- define new X and Y positions for the first label. X = 0.0825 y = 0.2 -- define new Width and Height values for the first label. Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window). guiCreateLabel (X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value so the second label is slightly below the first. Y = 0.5 guiCreateLabel (X, Y, Width, Height, "password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit (X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit (X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50. guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) -- now add our onClientGUIClick event to the button we just created. addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) -- make the window invisible guiSetVisible(wdwLogin, false) -- create the function and define the 'button' and 'state' parameters. -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) -- if our login button was clicked with the left mouse button, and the state of the mousebutton is up: if button == "left" and state == "up" then -- get the text entered in the 'username' field. local username = guiGetText(edtUser) -- get the text entered in the 'password' field. local password = guiGetText(edtPass) -- if the username and password both exist: if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it. triggerServerEvent("submitLogin", getRootElement(), username, password) -- move the input focus back on the game (allowing players to move arround, open the chatbox, etc) guiSetInputEnabled(false) -- hide the window and all the components. guiSetVisible(wdwLogin, false) -- hide the mouse cursor. showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui. outputChatBox("please enter a username and password.") end end end end -- attach the event handler to the root element of the resource. -- this means it will only trigger when it's own resource is started. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () -- create the log in window and it's components. createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to BlackDeath's Alpha Server, Please log in with the login information provided to you") -- if the GUI was successfully created, then show the GUI to the player. if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasn't been properly been created, tell the player. outputChatBox("An unexpected error has occurred and the login GUI has not been created.") end -- enable the players cursor (so that they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening. guiSetInputEnabled(true) end ) -- attach the event onClientGUIClick to btnLogin and set it to trigger the 'clientSubmitLogin' function. addEventHandler("onClientGUIClick", btnLogin, clientSumbitLogin, false) And like Draken said, this script wont work.
  7. You downloaded something for free, now you're trying to sell/trade "it". To simplify things, you re-uploaded something, claiming it as yours after modifying a line or two. It is stealing, and now you're trying to scam people by attempting to trade things who doesn't belong to you. And then the lies. No one will fall for this offer, but since you're a scripter, why would you trade a script for a script? Script it yourself, "scripterr".
  8. Absence2

    fix . .

    https://wiki.multitheftauto.com/wiki/SetPlayerName
  9. local restriction = {} addCommandHandler("roll", function(player, cmd) local playerName = getPlayerName ( player ) if restriction[player] then local sMessage = "You have to wait 30 seconds" outputChatBox(sMessage, player, 255, 0, 0) else restriction[player] = true setTimer(restrictionEnd, 30000, 1, player) local randomroll = math.random(1, 3000) local roller = math.random(1, 4) local weapon = math.random(1, 40) if ( roller == 1 ) then givePlayerMoney(player, randomroll) local sMessage = playerName .. ' roll and wins ' .. randomroll .. ' !' triggerClientEvent("new", root, sMessage) elseif ( roller == 2 ) then local sMessage = playerName .. ' roll and is now changed the Weapon ' .. getWeaponNameFromID ( weapon ) .. '!' giveWeapon(player, weapon) triggerClientEvent("new", root, sMessage) else local sMessage = "Good luck next time!" outputChatBox ( sMessage, player, 255, 0, 0) end end end ) function restrictionEnd(player) restriction[player] = nil end
  10. Absence2

    Server name

    edit you mtaserver.conf Default MTA Server
  11. https://community.multitheftauto.com/index.php?p=resources => guieditor
  12. this will spawn you in the middle of GTA SA world (x=0, y=0, z=3) after 2 seconds of your death addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 ) end ) you mean this?? https://wiki.multitheftauto.com/wiki/OnPlayerWasted
  13. http://development.mtasa.com/index.php? ... awnmanager this? you can find resource @ https://community.multitheftauto.com if you don't want to try yourself This should give you an idea on how to do things. It's very detailed info.
  14. What exactly is a deathWarp? if it is what I think it is, I guess these should help, I'm not even near sure though. spawnPlayer triggerServerEvent
  15. https://wiki.multitheftauto.com/wiki/Control_names but like solid said, enter_exit - Make the player exit a vehicle, just thought it would be useful to let you know everything can be found there.
  16. Do this and you steal. So it is basically stealing if you perform this act, just like he did. Plus, this isn't a place for english lessons. I skip school for a reason, I don't plan on being lectured here.
  17. That's basically stealing.
  18. Shouldn't double post there, mate. Also check https://community.multitheftauto.com/ => gate I guess you'll get the main idea by looking into those scripts, other than that, you should just follow the links aldready given to you
  19. I'm not trying to disturb or spam or anything like that but am I the only one who gets a skype phone number from this line? Uhm, Solomon Islands. Just curious LsMarket = createColSphere(783.00677490234,-1337.8107910156,-0.6554099082947,3)
  20. lol https://community.multitheftauto.com > radar
  21. Absence2

    about GUİ

    Use bindKey clientside with GuiSetVisible https://wiki.multitheftauto.com/wiki/GuiSetVisible function changeVisibility ( ) -- we check if the gui element is visible if guiGetVisible ( myWindow ) then -- if it is, we hide it guiSetVisible ( myWindow, false ) else -- if not, we make it visible guiSetVisible ( myWindow, true ) end end --Create a gui window called 'myWindow' myWindow = guiCreateWindow ( 0.3, 0.3, 0.5, 0.60, "GUI window title", true ) --Set a timer to change the window's visibility every 2 seconds, infinite times setTimer ( changeVisibility, 2000, 0 ) https://wiki.multitheftauto.com/wiki/GuiGetVisible function guiToggleVisible ( ) if ( guiGetVisible ( myWindow ) == true ) then -- check if the gui element is visible guiSetVisible ( myWindow, false ) -- if it is, we hide it else guiSetVisible ( myWindow, true ) -- if not, we make it visible end end myWindow = guiCreateWindow ( 0, 0, .5, .5, "my window", true ) -- Create the gui window bindKey ( "space", "down", guiToggleVisible ) --bind the player's spacebar to the function guiToggleVisible
  22. Absence2

    about GUİ

    check wiki: these are just examples from wiki, should help. showCursor ( true ) -- Shows cursor showCursor ( false ) -- Doesnt Show Cursor function funcInput ( key, keyState ) local state = "let go of" if ( keyState == "down" ) then state = "pressed" end outputChatBox ( "You " .. state .. " the " .. key .. " key!" ) end function bindTheKeys () bindKey ( "F1", "down", funcInput ) -- bind the player's F1 down key (when they press it) end addCommandHandler ( "bindme", bindTheKeys ) function greetingCommand ( commandName ) triggerServerEvent ( "onGreeting", getLocalPlayer(), "Hello World!" ) -- getLocalPlayer instead of getRootElement makes the client player the 'source' on the server function, eliminating the need for an additional player argument to be transferred. end addCommandHandler ( "greet", greetingCommand )
  23. denny, I just copied the Wiki's example as he didn't understand my first post and deleted it's mid content. I didn't read thru it at all. and function createText ( ) -- add your code here -- ur forgot a END end function TheRendering ( ) addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender. end addEventHandler ( "onClientResourceStart", resourceRoot, TheRendering ) --and if u wanna stop rendering function stopTheRendering ( ) removeEventHandler ( "onClientRender", root, createText ) --now removing the eventhandler end addCommandHamdler ( "stoprender", stopTheRendering )
  24. no I mean, onClientRender keeps dxDrawText visible, so whatever you're drawing, use onClientRender like this within the main function/eventhandler function createText ( ) -- add your code here function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender. end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )
  25. OnClientRender keeps it visible example: dxDrawText
×
×
  • Create New...