Jump to content

Controlled

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by Controlled

  1. Alright so thanks for the help so far, my question about the GUI is answered. But I don't understand how I could get something like this to run a certain number of times. exports.global:giveItem(source, 115, weapon..":"..mySerial..":"..getWeaponNameFromID(weapon)) So for example that would run once, twice, or 3 times based on the number you put in the GUI.
  2. How would I transfer information that someone placed onto a GUI(Like a text or number) to server side? And how can I run something multiple times without spamming the script. For example removeElementData(thePlayer, "hello")*2 Would run that twice. Bit of a a bad example but I think you get the idea. That would run that removeElementData twice and save the space/time
  3. That script is not the issue. The one I posted before is the issue.
  4. Returns the Error, Attempt to Index Field "?" (A Nil Value) on Stats = tonumber(mResult2[1]["vp"]
  5. And I thought that at first too, so I made this. function old( thePlayer ) if thePlayer then local logged = getElementData(thePlayer, "loggedin") if (logged==1) then local gameAccountID = getElementData(thePlayer, "account:id") local dbid = getElementData(thePlayer, "dbid") mResult2 = exports.mysql:query_fetch_assoc("SELECT `vp` FROM `accounts` WHERE `id`='".. tostring(gameAccountID) .."'") Stats = tonumber(mResult2["vp"]) if (Stats>0) then outputChatBox("You have", thePlayer) else outputChatBox("You don't", thePlayer) end end end end addCommandHandler("checkVP", old) It worked fine without errors.
  6. Wouldn't that be Nil with Number? Not Number with Nil?
  7. local gameAccountID = getElementData(thePlayer, "account:id") local dbid = getElementData(thePlayer, "dbid") mResult2 = exports.mysql:query_fetch_assoc("SELECT `vp` FROM `accounts` WHERE `id`='".. tostring(gameAccountID) .."'") Stats = tonumber(mResult2["vp"]) elseif (Stats>0) then setPlayerNametagColor(thePlayer, 167, 133, 63) Error is Number with Nil on elseif line. How can 0 be Nil? lol I tried writing it like Stats > 0 Stats>0 (Stats > 0) (Stats>0) All the same lol
  8. I went to using fetchRemote.. Just a question about it. Can I get it to show a percent progress? So they know how the download is going?
  9. This is how I had it written.. Server: function download() local open = fileOpen("BUyJfGFCMAEe5BI.jpg") local content = fileRead("BUyJfGFCMAEe5BI.jpg", fileGetSize("BUyJfGFCMAEe5BI.jpg")) -- if you wanna open huge files, use a smaller buffer instead to save memory triggerLatentClientEvent(source, "runMod", resourceRoot, content) end addCommandHandler("dicks", download) Client addEvent("runMod", true) function runMod() local hfile = fileOpen("BUyJfGFCMAEe5BI.jpg", false) if hfile then outputDebugString("You have it") else fileCreate("BUyJfGFCMAEe5BI.jpg") fileWrite(hfile, content) outputDebugString("Done") end end addEventHandler("runMod", resourceRoot, runMod) I am getting errors from Server Side saying bad file pointer. Also Expected String at Argument 1 got nil. For triggerLatentEvent Thats simply to download it, not to apply anything
  10. Thanks! Is there any way to have a progress bar of some sorts? so it tells you what your progress is? and I'm not sure what you mean about opening huge files?
  11. I am having trouble following. fileRead("mod.txd") triggerClientEvent(source, "runmod", source) For server? Then what were you saying about client
  12. Hmm. Can you give me a example for file read? I want a Mod for a vehicle download when a command is used. When I looked at the wiki it was talking about bytes.. Once the file is downloaded I need it to apply the txd..
  13. Do you have "hitElement" "weapon" or "theWL" defined?
  14. Is it possible to have something download via command? or event? Like have the resource start then typing /download and getting certain files i specify?
×
×
  • Create New...