Jump to content

.:HyPeX:.

Members
  • Posts

    1,255
  • Joined

  • Last visited

Everything posted by .:HyPeX:.

  1. Found this, what should i be editing? (How could i load in here data from the IPB Database) {{$idField = $comment::$databaseColumnId;}} {{$itemClassSafe = str_replace( '\\', '_', mb_substr( $comment::$itemClass, 4 ) );}} {{if $comment->isIgnored()}} <div class='ipsComment ipsComment_ignored ipsType_light' id='elIgnoreComment_{$comment->$idField}' data-ignoreCommentID='elComment_{$comment->$idField}' data-ignoreUserID='{$comment->author()->member_id}'> {lang="ignoring_content" sprintf="$comment->author()->name"} <a href='#elIgnoreComment_{$comment->$idField}_menu' data-ipsMenu data-ipsMenu-menuID='elIgnoreComment_{$comment->$idField}_menu' data-ipsMenu-appendTo='#elIgnoreComment_{$comment->$idField}' data-action="ignoreOptions" title='{lang="see_post_ignore_options"}' class='ipsType_blendLinks'>{lang="options"} <i class='fa fa-caret-down'></i></a> <ul class='ipsMenu ipsHide' id='elIgnoreComment_{$comment->$idField}_menu'> <li class='ipsMenu_item ipsJS_show' data-ipsMenuValue='showPost'><a href='#'>{lang="show_this_post"}</a></li> <li class='ipsMenu_sep ipsJS_show'><hr></li> <li class='ipsMenu_item' data-ipsMenuValue='stopIgnoring'><a href='{url="app=core&module=system&controller=ignore&do=remove&id={$comment->author()->member_id}" seoTemplate="ignore"}'>{lang="stop_ignoring_posts_by" sprintf="$comment->author()->name"}</a></li> <li class='ipsMenu_item'><a href='{url="app=core&module=members&controller=ignore" seoTemplate="ignore"}'>{lang="change_ignore_preferences"}</a></li> </ul> </div> {{endif}} <a id='comment-{$comment->$idField}'></a> <article itemscope {{if $item->isQuestion() && !$comment->new_topic}}itemprop="suggestedAnswer {{if $comment->post_bwoptions['best_answer']}}acceptedAnswer{{endif}}" itemtype="http://schema.org/Answer"{{else}}itemtype="http://schema.org/Comment"{{endif}} id='elComment_{$comment->$idField}' class='cPost ipsBox {{if $otherClasses}}{$otherClasses}{{endif}} ipsComment {{if settings.reputation_highlight and $comment->reputation() >= settings.reputation_highlight}}ipsComment_popular{{endif}} ipsComment_parent ipsClearfix ipsClear ipsColumns ipsColumns_noSpacing ipsColumns_collapsePhone {{if $comment->isIgnored()}}ipsHide{{endif}} {{if $comment->hidden()}}ipsModerated{{endif}}'> {{if $item->isQuestion() and !$comment->new_topic}} {template="postRating" group="topics" app="forums" params="$item, $comment, $votes"} {{endif}} <aside class='ipsComment_author cAuthorPane ipsAreaBackground_light ipsColumn ipsColumn_medium'> <h3 class='ipsType_sectionHead cAuthorPane_author ipsType_blendLinks ipsType_break' itemprop="creator" itemscope itemtype="http://schema.org/Person"><strong itemprop="name">{$comment->author()->link( $comment->warningRef() )|raw}</strong> <span class='ipsResponsive_showPhone ipsResponsive_inline'> {template="reputationBadge" group="global" app="core" params="$comment->author()"}</span></h3> <ul class='cAuthorPane_info ipsList_reset'> {{if $comment->author()->member_title && $comment->author()->member_id}} <li class='ipsResponsive_hidePhone'>{$comment->author()->member_title}</li> {{elseif $comment->author()->rank['title'] && $comment->author()->member_id}} <li class='ipsResponsive_hidePhone'>{$comment->author()->rank['title']}</li> {{endif}} {{if $comment->author()->rank['image'] && $comment->author()->member_id}} <li class='ipsResponsive_hidePhone'>{$comment->author()->rank['image']|raw}</li> {{endif}} <li class='cAuthorPane_photo'> {template="userPhoto" app="core" group="global" params="$comment->author(), 'large', $comment->warningRef()"} </li> <li>{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}</li> {{if \IPS\Member\Group::load( $comment->author()->member_group_id )->g_icon }} <li class='ipsResponsive_hidePhone'><img src='{file="$comment->author()->group['g_icon']" extension="core_Theme"}' alt='' class='cAuthorGroupIcon'></li> {{endif}} {{if $comment->author()->member_id}} <li class='ipsResponsive_hidePhone'>{template="reputationBadge" group="global" app="core" params="$comment->author()"}</li> <li class='ipsType_light'>{lang="member_post_count" pluralize="$comment->author()->member_posts"}</li> {{if $comment->author()->reputationImage()}} <li class='ipsPad_half ipsResponsive_hidePhone'> <img src='{file="$comment->author()->reputationImage()" extension="core_Theme"}' title='{{if $comment->author()->reputation()}}{$comment->author()->reputation()}{{endif}}' alt=''> </li> {{endif}} {template="customFieldsDisplay" group="global" app="core" params="$comment->author()"} {{endif}} </ul> </aside> <div class='ipsColumn ipsColumn_fluid'> {template="post" group="topics" app="forums" params="$item, $comment, $item::$formLangPrefix . 'comment', $item::$application, $item::$module, $itemClassSafe"} </div> </article>
  2. Are you sure that applies to IPS 4.x? this is the file directory of applications>forums
  3. Hello everyone, so i'm stuck trying to know how to add server information into my profile feed from each post i.e. So far i could make this by adding a custom profile field - But this had one big issue: i cant force it on every single profile, or i do not know how. Any help would be greatly appreciated.
  4. Thanks for the reply! thought in the end i ended doing a simple query and checking for results and doing an dbExec if no results
  5. .:HyPeX:.

    MySQL help

    Well idk why i'm getting syntax error, since in theory this mysql syntax is fine.. error near 'IF EXISTS (SELECT * FROM statTable WHERE user = ?)' addCommandHandler('db',function(player,cmd) outputChatBox('db') local source = player local acc = getElementData(source,'username') if not acc then outputChatBox('no acc') return end dbQuery( function(qh,rows,columns) local result = dbPoll(qh,0) outputChatBox('affected: ') end, Database, [[ IF EXISTS (SELECT * FROM statTable WHERE user = ?) BEGIN END ELSE BEGIN INSERT INTO statTable ( (user, name, serial, cash, exp, playtime, joins, hunters, kills, deaths, mapsplayed, mapswon ) VALUES ( ?,?,?,0,0,0,1,0,0,0,0,0 ) ) END ]],acc,acc,getPlayerName(source):gsub('#%x%x%x%x%x%x',''),getPlayerSerial(source) ) end)
  6. Adding things like weapons / objects to GTA via MTA is still not possible else than replacing the current ones.
  7. This did the work, thanks anyways <?php $password = $_GET["password"]; $salt = $_GET["salt"]; $crypted = crypt( $password, '$2a$13$' . $salt ); echo $crypted; ?>
  8. Hello guys, up to a while ago on IPB i used the usual md5(md5(salt)..md5(password)) but that no longer works as implied by IPS since they now use something called "Blowfish" HERE and i'm not even sure this can be decrypted in MTA to compare a password, anyone knows any workarround? Greets
  9. Old topic but bumping since i had an issue setting up a new VPS, did the 32bit download of the file, now it gives the same error but ELFCLASS32?! Wth? I had the ELFCLASS64, so i downloaded the 32bit lib and now it gives error ELFCLASS32, its a debian 7 wheezy 64bit. EDIT: Apparently tried to re-download the 64bit lib and it worked now, but that info should be told, that now the 64bit lib works
  10. Alright, thanks for that! Honestly i was already about to give up on this, but i guess i'll try doing that. The file path should be the one http://mta/etc for the video path?
  11. Anyone knows how to make this work? probably an error with the video source load path? i tried using the scheme offered by MTA (http://mta) but that wouldnt work either
  12. Okay, this is driving me nuts, for some reason the CEF wont load my mp4 file and just go blank. Also seems like texts are way small. http://i.imgur.com/R6eOcO9.png http://i.imgur.com/HORPAR2.png <!DOCTYPE html> <html> <body> <button onclick="playVid()" type="button">Play Video</button> <button onclick="pauseVid()" type="button">Pause Video</button><br> <video id="myVideo" width="320" height="176"> <source src="emp.mp4" type="video/mp4"> Your browser does not support HTML5 video. </video> <script> var vid = document.getElementById("myVideo"); vid.autoplay = true; vid.load(); function playVid() { myVideo.play(); } function pauseVid() { myVideo.pause(); } </script> <p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p> </body> </html>
  13. Well i've tried this out, but i cant get somewhat CEF to load the video. Tried loading a basic HTML page locally, and drawing it, but it will be somehow drawn blank.. PD: No errors in debug local browser = createBrowser(x,y,true,false) addEventHandler("onClientBrowserCreated", browser, function() loadBrowserURL(browser, "http://mta/local/html/file.html") end ) function BackGroundDrawing() dxDrawImage(0,0,x,y, browser,0,0,0) end addEventHandler('onClientRender', root, BackGroundDrawing,true, "high+6") HTML file: <!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html>
  14. You're missing the DB connection at the top of the script. qh is the return you get from the dbQuery. I.e. Database = dbConnect("mysql","dbname=d69588_forumm;host=127.0.0.1", "root","4rpL=VY&D7k#qcu") You might get lost due to how it is arranged; it is a function and the end of the dbQuery its at the bottom, look at example 4 from dbQuery
  15. Try to running a loop to output all keys into the chat. i.e. for key,value in pairs(handlingTable) do outputChatBox(key) end About the separation into parts.. i guess the hedit does it manually.
  16. Well i'm attaching elements to my vehicle, however, if the vehicle stands still, the object wont be visible (Becouse i spawned it at corrds 0,0,0) until it moves, then MTA will move the element to the vehicle at given offsets. Is there any way to force the attach element when the function is run to go to the vehicle? (setElementPosition / Velocity did not work) Greetz
  17. Do you mind trying to get the lua syntax checker with the MTA one from 50p? (Not necesarilly detect MTA's function, but just lua and leaving it at the same time without needing to switch to the default lua syntax), and yea, you can use the images, i did them with that purpose
  18. Hello, is there any way to get the position of a vehicle's roof or top? becouse on a bike it is different from a vehicle and a different Z fixed value overkills it..
  19. IPB Hashes the passwords for security reasons. This function checks if the player's input username & password are correct in the forum and logs the player into the same-name server account, changing it its password to the forum's one or creating it if necessary. You should check for the forum database if the fields are the same, since they tend to change depending on the IPB version. Up to line 35 its all the password process if you want to only look for that. function PlayerLogin(username,password,checksave) if not (username == "") then username = string.lower(username) if not (password == "") then local query = dbQuery(function(qh,source,username,password) local result, num_affected_rows, last_insert_id = dbPoll(qh,0) if result then local salt,mysqlhash = "","","" local Nsalt,Nhash = nil,nil for _,row in ipairs(result) do for column, value in pairs ( row ) do if column == "members_pass_salt" then salt = value Nsalt = true elseif column == "members_pass_hash" then mysqlhash = value Nhash = true elseif column == "member_id" then member_id = value end end end if not Nsalt or not Nhash then triggerClientEvent(source,"LoginR",resourceRoot,"Login","user") return end if salt and mysqlhash and password then local hash = lowermd5(lowermd5(salt)..lowermd5(password)) if hash == mysqlhash then if getAccount(username) then local acc = getAccount ( username, password ) if ( account ~= false ) then triggerClientEvent(source,"LoginR",resourceRoot,"Login","success") local account = getAccount ( username,password) if ( account ~= false) and (account ~= nil) then logIn(source, account, password) setCameraTarget(source, source) Logged(source,member_id) else setAccountPassword(getAccount(username), password) local account = getAccount(username,password) logIn(source, account, password) Logged(source,member_id) setCameraTarget(source, source) end else setAccountPassword(getAccount(username), password) triggerClientEvent(source,"LoginR",resourceRoot,"Login","success") local account = getAccount ( username,password) logIn(source, account, password) Logged(source,member_id) setCameraTarget(source, source) end else addAccount(username,password) triggerClientEvent(source,"LoginR",resourceRoot,"Login","success") local account = getAccount ( username,password) logIn(source, account, password) Logged(source,member_id) setCameraTarget(source, source) end else triggerClientEvent(source,"LoginR",resourceRoot,"Login","pass") end end else local error_code,error_msg = num_affected_rows,last_insert_id end end,{source,username,password},Database, "SELECT members_pass_salt,members_pass_hash,member_id FROM members WHERE name='"..username.."'") else triggerClientEvent(source,"LoginR",resourceRoot,"Login","pass") end else triggerClientEvent(source,"LoginR",resourceRoot,"Login","user") end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) EDIT: lowermd5 usefull function: function lowermd5(val) return string.lower(md5(val)) end
  20. check here : http://i.imgur.com/SdK6dGy.jpg You're not explaining anything, i just see a marker..
  21. I have studied the moon however I know there is something more difficult in order'm exhausted understand I start with this 9 am and stop by 3 am that this hurting me. Out estrece not understand the source of the error sooner will gain more experience and so I can finish this script. Anyways, look over at the tutorials sub-forum, there are quite a few good ones.
  22. The code is quite big and i cant find any errors overhead, could you try to explain better what the issue is so i know what i'm looking for?
  23. Depends on the image, If the image is vertical by default, then on a rotation (speed) 0 it will be on the 120. I'm not sure whats the correct rotation on that image of your speedo, you'll need to play with it (I randomized 120degrees). Try adjusting it g_root = getRootElement() g_rootElement = getResourceRootElement( getThisResource() ) g_Player = getLocalPlayer() c_EnableScaling = true c_XOffset = 10 c_YOffset = 10 c_ImageW = 200 c_ImageH = 200 c_BarW = 0 c_BarH = 0 c_BarYOffset = 70 c_FireTimeMs = 5000 c_BarAlpha = 120 c_BarFlashInterval = 300 g_tFireStart = nil function drawNeedle() if not isPedInVehicle(g_Player) then hideSpeedometer() end local vehSpeed = getVehicleSpeed() if vehHealth and (vehHealth > 0) then local hp = (vehHealth-250)/750 local curBarLen = hp*g_BarW if curBarLen < 1 then curBarLen = 1 end local r = 255*(1 - hp)/0.5 if r > 255 then r = 255 end local g = 255*hp/0.5 if g > 255 then g = 255 end if g < 0 then g = 0 end if hp >= 0 then g_tFireStart = nil dxDrawRectangle(x + g_ImageW/2 - g_BarW/2, y + g_BarYOffset, curBarLen, g_BarH, tocolor(r, g, 0, c_BarAlpha)) else if not g_tFireStart then g_tFireStart = getTickCount() end local firePerc = (c_FireTimeMs - (getTickCount() - g_tFireStart)) / c_FireTimeMs if firePerc < 0 then firePerc = 0 end local a = c_BarAlpha if (getTickCount()/c_BarFlashInterval)%2 > 1 then a = 0 end dxDrawRectangle(x + g_ImageW/2 - g_BarW/2, y + g_BarYOffset, firePerc*g_BarW, g_BarH, tocolor(255, 0, 0, a)) end end dxDrawImage(x, y, g_ImageW, g_ImageH, "needle.png", vehSpeed -120, 0, 0, white, true) end function showSpeedometer() guiSetVisible(disc, true) addEventHandler("onClientRender", g_root, drawNeedle) end function hideSpeedometer() guiSetVisible( disc, false) removeEventHandler("onClientRender", g_root, drawNeedle) end function getVehicleSpeed() if isPedInVehicle(g_Player) then local vx, vy, vz = getElementVelocity(getPedOccupiedVehicle(g_Player)) return math.sqrt(vx^2 + vy^2 + vz^2) * 161 end return 0 end addEventHandler("onClientVehicleEnter", g_root, function(thePlayer) if thePlayer == g_Player then showSpeedometer() end end ) addEventHandler("onClientVehicleStartExit", g_root, function(thePlayer) if thePlayer == g_Player then hideSpeedometer() end end ) function round(num) return math.floor(num + 0.3) end function initGui() if disc then destroyElement(disc) end g_screenWidth, g_screenHeight = guiGetScreenSize() local scale if c_EnableScaling then scale = (g_screenWidth/1000 + g_screenHeight/850)/2 else scale = 1 end g_XOffset = round(c_XOffset*scale) g_YOffset = round(c_YOffset*scale) g_ImageW = round(c_ImageW*scale) g_ImageH = round(c_ImageH*scale) g_BarW = round(c_BarW*scale) g_BarH = round(c_BarH*scale) g_BarYOffset = round(c_BarYOffset*scale) disc = guiCreateStaticImage(g_screenWidth - g_ImageW - g_XOffset, g_screenHeight - g_ImageH - g_YOffset, g_ImageW, g_ImageH, "disc.png", false) x, y = guiGetPosition(disc, false) end addEventHandler("onClientResourceStart", g_rootElement, function () initGui() guiSetVisible(disc, false) setTimer(function() local w, h = guiGetScreenSize() if (w ~= g_screenWidth) or (h ~= g_screenHeight) then initGui() end end, 500, 0) if isPedInVehicle(g_Player) then showSpeedometer() end end )
  24. We dont help with other people's resources unless you have authorization from them. (Y'know, stealing). I'd ask for any mod to close the topic.
×
×
  • Create New...