Jump to content

Ryan2233

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by Ryan2233

  1. Hello. I have a login panel, and a spawn panel. Once the player has logged in/registered, a login panel should show up as soon as the login is successful and when the player dies, the spawn menu should show. But the panel only shows when the player dies, and a black screen when logging in. What do I do?
  2. I restarted and reinstalled it - no success.
  3. Hi, I just opened MTA after months of not playing, and got this. WHat do I do ?
  4. Hello everyone, I'm a beginner scripter myself, but I've came across a problem so overwhelming for me. My friend gave me a login panel, but it's not doing anything, all i've done is add it to the admin acl, maybe i'm missing something? Once username and password is entered, literally, nothing happens. Code concerning the login: function loginActions() if source == button[1] then local username = guiGetText(edit[1]):lower() local password = guiGetText(edit[2]) if (username ~= "") and (password ~= "") then if editModified then triggerServerEvent("sendLogin", getLocalPlayer(), username, sha256(password)) else triggerServerEvent("sendLogin", getLocalPlayer(), username, password) end else showLoginError("Please enter your username and password.") end elseif source == button[2] then guiSetVisible(window[1], false) guiSetVisible(window[2], true) end end
  5. Can you share your full code?
  6. Ryan2233

    Help

    I'm not going to make it for you, but give you some tips for what you can do, but please do some wiki research to implement it all properly. If I was you, here is what I would do. Find a way to get the player to reload his weapon, createReloadMarker = createMarker([coordinates of the marker here, here, here], "cylinder") Then trigger the player entering the marker with an event handler addEventHandler("onMarkerHit", createReloadMarker, [nameOfTheFunctionYouTrigger]) The [nameOfTheFuntionYouTrigger] is the name of the function you trigger when the player enters the marker. You then show the player some kind of information to reload his weapon. That can be done via a GUI or key binding. Once you did that, you reload the players weapon, you can do something like this function reloadTheAmmo(thePlayer) setWeaponAmmo(thePlayer, 30, 30) end To be honest, it's more complicated using a table, so use the setWeaponAmmo for all the guns. (The 30 is the gun id, the second 30 is the ammo amount). I've given you the basic idea you will need and the basic functions you'll need to make this script; but to progress you must make it all yourself and I purposely left stuff out because I'd like you to read the respected functions there as it's more knowledgeable than me. https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions Good luck!
  7. Hi, I have a login panel that works; and I have a spawn panel. (List of cities, spawns and jobs). The spawn panel opens once the player dies, however, I'd like it to open when the player logs in but currently gets a black screen. How could I do that? Thank you.
  8. Hi there, their is a few ways to trigger code on another script type. The most common way is to create a custom event, and trigger it. How you'd do it is: Make a custom event below the function you wish to trigger. So since you didn't provide your function where the outputChatBox(msg, selectedplayer, 255, 255, 255, true) Is. So I'll make one, but obviously, use your own. So here's what we have now. function outputTheMessage() outputChatBox(msg, selectedplayer, 255, 255, 255, true) end Then, we add addEvent("outputMessage", getRootElement, outputTheMessage) ) So now we have function outputTheMessage() outputChatBox(msg, selectedplayer, 255, 255, 255, true) end addEvent("outputMessage", getRootElement, outputTheMessage) ) Then on the server side, we can trigger the event. Now remember, this method can be used on any side. If you wish to trigger a server function on a client script, do the above there also. But the triggers are different for both sides. Client ~ triggerClientEvent() (Just to clear up, triggerClientEvent is used on the server to trigger the outputMessage custom event we made above) Server ~ triggerServerEvent() So in backup, triggerServerEvent is used to trigger a server event on a client script. And vice versa. So to finish this off, we want triggerClientEvent since we want to trigger a client event we made in a server client. So go to your server script, to the function you want to call the function outputTheMessage() outputChatBox(msg, selectedplayer, 255, 255, 255, true) end And inside of the server function, put triggerClientEvent(outputMessage, getRootElement) I've not tested it, if you get further errors, please say.
  9. The screenshot isn't working, can you share the error?
  10. Firstly, can you share all of your code. Secondly, do you get any errors in /debugscript 3?
  11. function detectHit() if getElementType(markerBlip)=="vehicle" then outputChatBox("Get out of that vehicle",markerBlip,255,0,0) else outputChatBox("Get out of that vehicle",markerBlip,255,0,0) end end function devMarker() local deliveryMarker = createMarker(-2300.9340820313, -1649.5125732422, 483.56658935547, "checkpoint") local markerBlip = createBlipAttachedTo(deliveryMarker, 23) addEventHandler("onMarkerHit", markerBlip, devMarker) end function setupSpawns(thePlayer, command) local x, y, z = getElementPosition(thePlayer) local helicopter = createVehicle(417, 0, 0, 0) local spawnVehicle = spawnVehicle (helicopter, x+3, y+3, z) if spawnVehicle then exports.SANGcommands:sendMessage("A helicopter has been abandonded (R Icon). Deliver it for a good payday!", 255, 255, 255) local heliBlip = createBlipAttachedTo(helicopter, 34) end end addCommandHandler("startheli", setupSpawns) addCommandHandler("startheli", devMarker) setElementParent(heliBlip, helicopter) [expected element at argument 1, got nil] ~ How to fix?
  12. function detectHit() if getElementType(markerBlip)=="vehicle" then outputChatBox("Get out of that vehicle",markerBlip,255,0,0) else outputChatBox("Get out of that vehicle",markerBlip,255,0,0) end end function devMarker() local deliveryMarker = createMarker(-2300.9340820313, -1649.5125732422, 483.56658935547, "checkpoint") local markerBlip = createBlipAttachedTo(deliveryMarker, 23) addEventHandler("onMarkerHit", markerBlip, devMarker) end function setupSpawns(thePlayer, command) local x, y, z = getElementPosition(thePlayer) local helicopter = createVehicle(417, 0, 0, 0) local spawnVehicle = spawnVehicle (helicopter, x+3, y+3, z) if spawnVehicle then exports.SANGcommands:sendMessage("A helicopter has been abandonded (R Icon). Deliver it for a good payday!", 255, 255, 255) local heliBlip = createBlipAttachedTo(helicopter, 34) end end addCommandHandler("startheli", setupSpawns) addCommandHandler("startheli", devMarker) setElementParent(heliBlip, helicopter) [expected element at argument 1, got nil] ~ How to fix?
  13. The "Your request for a staff member has been accepted. One of our staff members will be with you soon" shows but the one that appears for the admins didn't
  14. There's no errors or anything but it doesn't show still
  15. No. Bad argument @ 'getPlayerAccount' [Expected Element at argument 1, got nil]
  16. Hi. The script I'm trying to make is a player who needs help does /adminreq and he gets a message saying admin is coming and admins, supermoderators and moderators get a message saying they are needed by the person who requested. Current code: function requestAdmin(playerName) exports.SANGcommands:sendMessage("Your request for a staff member has been accepted. One of our staff members will be with you soon", 225,255,255) local account = getPlayerAccount (thePlayer) if isObjectInACLGroup ("user." .. getAccountName(string(account)), aclGetGroup ("Admin", "SuperModerator", "Moderator")) and type == 0 then outputChatBox("You are required by ".. getPlayerFromName(playerName .. playerName) end end addCommandHandler("adminreq", requestAdmin) But when /adminreq is typed the first message shows but admins dont get the message. Why? (i'm new to lua)
  17. Hello, I'm fairly new to scripting lua, but I want to create the following script: Via Guieditor make a gui that allows to send money daily to a specific account automatically. (it's for business income). I don't really know where to start. Any tips?
  18. I try to add it using the both alter table and via the script.
  19. I did but I still get an error that it's missing. And in the SQLitebrowser the ID column doesn't show.
×
×
  • Create New...