Jump to content

Phoenix-Roleplay

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by Phoenix-Roleplay

  1. Resolved. Needed to do a work around and pull the data like so: local respPosT = {0,0,0,0,0,0} local respPos = getElementData(theVehicle, "respawnposition") if (type(respPos) == "table")) then respPosT = respPos end local x, y, z, rx, ry, rz = unpack(respPosT)
  2. Not sure if you fully understood me but I did a outputDebugString and it returned the table outputDebugString(x.." "..y.." "..z.." "..rx.." "..ry.." "..rz)
  3. Somehow this does not want to unpack properly yet, does at the same time.. local resppos = getElementData(theVehicle, "respawnposition") local x, y, z, rx, ry, rz = unpack(resppos) What I mean by this is, if I debug and tell it to output: "outputDebugString(x.." "..y.." "..z)" it outputs all the data. I even did if not x or not y or not z or not rx or not ry or not rz then outputDebugString("This is the issue here.") end and nothing was output so I put else outputDebugString("This is somehow the issue.") end and it output the data there. And when I look at the debug in game without any other debug I get this ERROR: bad argument #1 to 'unpack' (table expected, got boolean)
  4. Right. And thats all I want it to do, is work for the commands I have scripted.
  5. Yep, I know. My server doesn't use the ACL so much, it uses a SQL to check for admin. It's a completely seperate basis for the server.
  6. Simple problem, I am not familiar with using executeCommandHandler nor working with using "..." but it just fails to execute everytime. local execcmd = nil function executeCommand(thePlayer, commandName, exeCmd, targetPlayer, ...) if(exports.global:isPlayerOwner(thePlayer))then if not (exeCmd) or not (targetPlayer) then outputChatBox("Syntax: /"..commandName.." [player id] [cmd name] [arguments]", thePlayer, 255, 0, 0) return end if(...)then execcmd = executeCommandHandler(exeCmd,targetPlayer,...) if(execcmd)then outputChatBox("Command Execution successful!", thePlayer, 0, 255, 0) else outputChatBox("Command Execution failed!", thePlayer, 255, 0, 0) end else execcmd = executeCommandHandler(exeCmd,targetPlayer) if(execcmd)then outputChatBox("Command Execution successful!", thePlayer, 0, 255, 0) else outputChatBox("Command Execution failed!", thePlayer, 255, 0, 0) end end else outputChatBox("This.",thePlayer,255,0,0) end end addCommandHandler("exec", executeCommand)
  7. Thanks so much qais you helped me perfectly! Could not have been any better or any quicker! I will definitely be in contact with you again if I need more work!
  8. OK. So I am not exactly sure the issue here, but it fails to show the photo to anyone. Client: addEvent("onMyClientScreenShot",true) addEventHandler( "onMyClientScreenShot", resourceRoot, function( pixels ) if image then destroyElement(image) end image = dxCreateTexture( pixels ) daPic() end ) --local screen = dxCreateScreenSource ( 340, 380 ); local sWidth,sHeight = guiGetScreenSize() function daPic() dxUpdateScreenSource(image); addEventHandler("onClientRender", root, showSpeedPic) setTimer(removeDaAnnoyingThingy, 5000, 1); end addEvent("showPicture", true) addEventHandler("showPicture", getLocalPlayer(), daPic) function showSpeedPic() rect = dxDrawRectangle(20.0,209.0,295.0,255.0,tocolor(0,0,0,140),false) dxDrawImage( 28.0,217.0,279.0,238.0, image) end function removeDaAnnoyingThingy() removeEventHandler("onClientRender", root, showSpeedPic) end -------------------------------------------------- --[[ Show image addEventHandler( "onClientRender", root, function() if image then rect = dxDrawRectangle(20.0,209.0,295.0,255.0,tocolor(0,0,0,140),false) dxDrawImage( 28.0,217.0,279.0,238.0, image) setTimer(removeDaAnnoyingThingy, 5000, 1); end end )]] function getScreenSize(value,thePlayer) local x,y = guiGetScreenSize() triggerServerEvent("takePicture",getLocalPlayer(),value,thePlayer,x,y) end addEvent("getScreenSize",true) addEventHandler("getScreenSize",getRootElement(),getScreenSize) Server: function takePicture(value,thePlayer,x,y) takePlayerScreenShot(thePlayer,x,y,"speedcam",100) end addEventHandler( "onPlayerScreenShot", root, function ( theResource, status, pixels, timestamp, tag ) triggerClientEvent( root, "onMyClientScreenShot", resourceRoot, pixels ) -- Relay to all players end ) And I have added triggerClientEvent("getScreenSize",getRootElement(),value,thePlayer)
  9. Hello MTA, I have another small issue on my hand, but not so much an issue. Using dxCreateScreenSource is there a way to transmit the taken image from one clients screen and send the same image to other players? I am working on a speedcam that takes a photo of the player who sped and want to transit the image to every police on duty, the image displays to all police and to the violator only the police receive an image of themselves.
  10. Are kidding me Liam! Of course I remember you! You need to add me on Skype, I rarely get on Facebook or anything anymore. Thanks so much by the way! Take care. Regards, Chris Canfield
  11. This thread is getting interesting...
  12. Hey MTA! I just was toying around with Fraps and Windows Live Movie Maker, and I decided to make a video for a friend who has a car mod and showing my roleplay server under development. Thoughts and suggestions for my next video?
  13. @Cadu, can you send me a SS of what it displays IG? EDIT: Wait, nevermind I got it fully functional now using the fetch_assoc! Thanks so much everyone, special thanks to Cadu!
  14. I'll try that but if I am not mistaken, the row = mysql_fetch_rows should do that for me? EDIT: Yea, same problem. Doesn't seem to withdraw the date from row["admin"]
  15. Interesting find, pasted the EXACT code and I get this ERROR: pf\s_main.lua:17: attempt to index local `row` (a nil value) EDIT: Upon further inspection, row["admin"] is failing to be set at all.
  16. That would be entirely up to the user, as I am using my own admin script such things won't be seen in the resource.
  17. Alright, using that login works perfectly but still fails to retrieve the data (I presume..) function loginHandler(username,password) local result = mysql_query(handler, "SELECT * FROM accounts WHERE accname='" .. username .. "' AND accpassword='" .. password .. "'") local row = mysql_fetch_row(result) if(row)then outputChatBox("You have successfully logged in!", client, 0, 255, 0) setElementData(client, "logged", 1) setElementData(client, "account:admin", tonumber(row["admin"])) local AStatus = tonumber(row["admin"]) if (AStatus == 1) then outputChatBox("You are playing as a PR Moderator.", client, 0, 0, 255) elseif (AStatus == 2) then outputChatBox("You are playing as a PR Administrator.", client, 0, 0, 255) elseif (AStatus == 3) then outputChatBox("Welcome back, Phoenix.", client, 0, 0, 255) end outputChatBox(mysql_error(handler), client, 255, 0, 0) return true else outputChatBox("Your username and/or password is incorrect!", client, 255, 0, 0) triggerClientEvent(client, "displayLogin", getRootElement()) return false end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) Tried both variations on row["admin"] or row[1]["admin"]
  18. For some reason whenever I use row[1]["insert-block-here"] I get the following: ERROR: pf\s_main.lua:16: attempt to index field `?` (a nil value)
  19. Hello MTA! As some of you may know, I have been working on a free-roam server from nothing. And since I want to always contribute to the community, I've recently been donating to MTA and I want to share nearly every aspect of my vehicle-system for the free-roam sever. Currently there are the following commands: */v, /vx */cv */cc It is very bare at the moment, but as I update it on my server you can definitely expect to see updates for it on community.multitheftauto.com In detail on the cmds: */v: Spawns a vehicle 5 units on the x axis away from you. */vx: Spawns a vehicle 2 units on the z axis above you, warping you inside. */cv: Changes your current vehicle. */cc: Changes your current color. All above cmds support the 'random' feature meaning you can do /v(x) random, /cv random, /cc random random or /cc random color_id, /cc color_id random Download Thoughts, suggestions, what you expect to see in the next update, all feedback is welcome. (It's in my signature) Enjoy.
  20. I tried yours, it works without a doubt due to the fact that if account:admin was not set to anything above 0 (at least that we know of) it sets it to 3, so I changed it and switched it to 2 instead and whenever I join it says "PF Administrator" the issue it seems to be having is pulling the data from the row, as before we we're having this issue. Anyways, not getting any errors at all.
  21. Well paint me blue and call me betsy! ...I'm serious. All joking aside, I guess I was completely oblivious of it EDIT: tonumber doesn't seem to have fixed anything although I am no longer geting the error message... Hmmm..
  22. setElementData(client, "logged", 1) setElementData(client, "account:admin", row["admin"]) if (getElementData(client,"account:admin") > 0) then AStatus = getElementData(client,"account:admin") if (AStatus == 1) then outputChatBox("You are playing as a PR Moderator.", client, 0, 0, 255) elseif (AStatus == 2) then outputChatBox("You are playing as a PR Administrator.", client, 0, 0, 255) elseif (AStatus == 3) then outputChatBox("Welcome back, Phoenix.", client, 0, 0, 255) end end ERROR: pf\s_main.lua:17: attempt to compare number with nil
  23. Yes, amx, it should default be in there. Atleast when I checked earlier today it was
  24. Yes, it works. Now using your code: function loginHandler(username,password) local row = mysql_query(handler, "SELECT * FROM accounts WHERE accname='" .. username .. "' AND accpassword='" .. password .. "'") if( mysql_num_rows( row ) == 1 ) then outputChatBox("You have successfully logged in!", client, 0, 255, 0) return true else outputChatBox("Your username and/or password is incorrect!", client, 255, 0, 0) triggerClientEvent(client, "displayLogin", getRootElement()) return false end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) Will I still be able to pull data using row.x or row[x]? Or how would I go about doing this?
×
×
  • Create New...