Master_MTA Posted August 27, 2017 Posted August 27, 2017 (edited) what is the Wrong with this function savedplayers( img, errorr, plr ) local inf=getPlayerInfo(plr) if errorr == 0 then triggerClientEvent( plr, "clsavedplrs", plr, img,tostring(isPlayerAdminSkin(plr)) ) else outputChatBox(errorr)----------------------------------------------------------------->result is 1 triggerClientEvent( plr, "clsavedplrs", plr, false,tostring(isPlayerAdminSkin(plr))) end end for k,v in ipairs(getElementsByType('player'))do fetchRemote ( 'https://d.top4top.net/p_6026au3j1.png', savedplayers, "", false, v) end Edited August 27, 2017 by Master_MTA Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Moderators IIYAMA Posted August 27, 2017 Moderators Posted August 27, 2017 (edited) I do not know what is wrong with it at the moment. (it is just not visible) Afaik: Make sure you grant the resource the right to use fetchRemote. Because the resource can't use this function without permission of the acl. Also this might save you some server bandwidth: Everytime you call fetchRemote, it will start downloading the data from the url. (you don't want to do that per player) fetchRemote ( 'https://d.top4top.net/p_6026au3j1.png', function (...) for k,player in ipairs(getElementsByType('player'))do savedplayers(player, ...) end end, "", false) function savedplayers(plr, img, errorr ) Edited August 27, 2017 by IIYAMA Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Master_MTA Posted August 27, 2017 Author Posted August 27, 2017 i am already add the resource to Admin group in Acl i am also add the right function.fetchRemote to ACL right for Admin group this is the fall code function getPlayerImage(plr) local ser=getPlayerSerial(plr) local sl=dbPoll(dbQuery(db,'SELECT * FROM accounts WHERE serial=?',ser),-1) if #sl~=0 then return tostring(sl[1].imageurl) end return false end addEvent('checkplrs',true) addEventHandler('checkplrs',root,function() if #getElementsByType('player')==0 then return end if isSerialRegisterd(getPlayerSerial(source))then if isSerialSaved(getPlayerSerial(source)) then local img=getPlayerImage(source) local inf=getPlayerInfo(source) local acc=getAccount(inf[1].accname,inf[1].pass) if acc then logIn(source,getAccount(inf[1].accname),inf[1].pass) if isAccountRegisterd(user)then dbExec(db,'UPDATE accounts SET lastvisit=? WHERE accname=?',last,user) dbExec(db,'UPDATE accounts SET save=? WHERE accname=?',tostring(mm),user) else dbExec(db,'INSERT INTO accounts VALUES(?,?,?,?,?,?)',user,pass,getPlayerSerial(source),FormatDate('d/m/Y||h:i:s'),tostring(mm),'https://e.top4top.net/p_6029qsov1.png') end fetchRemote (img, savedplayers, "", false, source ) end else triggerClientEvent( source, "clnotsavedplrs", source ) end else triggerClientEvent( source, "clnotsavedplrs", source ) end end ) client side addEvent('clsavedplrs',true) addEventHandler('clsavedplrs',root,function(imgme,isad) if imgme~=false then img=dxCreateTexture( imgme ) else img='ss.png' end addEventHandler("onClientRender", root,intro) showChat(false) showCursor(true) setTimer(function() removeEventHandler("onClientRender", root,intro) fadeCamera(true) showCursor(false) isadmin=isad setCameraMatrix(-343.72479248047,1590.9632568359,92.085800170898,-343.18273925781,1590.126953125,92.003082275391,0,70) ped=createPed(287,-341.83081054688,1588.0413818359,91.196739196777) setPedAnimation(ped, "DANCING", "dnce_M_a",-1,true,false,false) addEventHandler('onClientKey',root,skinchose) end,1000*20,1) end) Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Moderators IIYAMA Posted August 27, 2017 Moderators Posted August 27, 2017 This is excluded the code of the previous messages. Tell me, where does the code stop working? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Master_MTA Posted August 27, 2017 Author Posted August 27, 2017 (edited) 5 minutes ago, IIYAMA said: This is excluded the code of the previous messages. Tell me, where does the code stop working? it's a small code from game mode so it doesn''t matter the code stop working at this code function savedplayers( img, errorr, plr ) local inf=getPlayerInfo(plr) if errorr == 0 then -------------------------[[it's get error at her andd didn't complete]]-- triggerClientEvent( plr, "clsavedplrs", plr, img,tostring(isPlayerAdminSkin(plr)) )---------------------i need to trigger client side from this trigger else outputChatBox(errorr)----------------and output 1 at chat box triggerClientEvent( plr, "clsavedplrs", plr, false,tostring(isPlayerAdminSkin(plr)))-------then it work perfectly at here end end Edited August 27, 2017 by Master_MTA Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Moderators IIYAMA Posted August 27, 2017 Moderators Posted August 27, 2017 errorr = 1? Is that the reason why it doesn't work? Which server version are you running? If it is lower than 1.5.2., try to upgrade it. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Master_MTA Posted August 27, 2017 Author Posted August 27, 2017 5 minutes ago, IIYAMA said: errorr = 1? Is that the reason why it doesn't work? Which server version are you running? If it is lower than 1.5.2., try to upgrade it. 1.5.4 and i change the syntax like that it's still output 1 bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] ) Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Moderators IIYAMA Posted August 27, 2017 Moderators Posted August 27, 2017 Do you have the same problem with other images of other servers? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Master_MTA Posted August 27, 2017 Author Posted August 27, 2017 2 minutes ago, IIYAMA said: Do you have the same problem with other images of other servers? yup Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Moderators IIYAMA Posted August 27, 2017 Moderators Posted August 27, 2017 and instead of and image, html code? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Master_MTA Posted August 27, 2017 Author Posted August 27, 2017 (edited) 8 minutes ago, IIYAMA said: and instead of and image, html code? no thing it's still output 1 https://wiki.multitheftauto.com/wiki/CURL_Errors i check it but i don't understand what does that mean CURLE_UNSUPPORTED_PROTOCOL why it's unsupported Edited August 27, 2017 by Master_MTA Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Master_MTA Posted August 27, 2017 Author Posted August 27, 2017 up Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Master_MTA Posted August 28, 2017 Author Posted August 28, 2017 up Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
MTA Team Lpsd Posted August 28, 2017 MTA Team Posted August 28, 2017 (edited) CURLE_UNSUPPORTED_PROTOCOL (1) The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for. Maybe it's because you're using https in the url (fetchRemote)? Try changing it to http Edited August 28, 2017 by LopSided_
Master_MTA Posted August 28, 2017 Author Posted August 28, 2017 11 minutes ago, LopSided_ said: CURLE_UNSUPPORTED_PROTOCOL (1) The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for. Maybe it's because you're using https in the url (fetchRemote)? Try changing it to http yup you are right thank you solved Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now