-
Posts
266 -
Joined
-
Last visited
Everything posted by Ryancit2
-
I am 80% sure that its one same issue, the marker is created with player position with z-axis = one less right (?) Its probably creating marker under the ground so that marker won't be triggered until someone hits marker right on the base of marker, check this code and tell me if it works: addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, d in pairs ( modelki ) do local x, y, z, rx, ry, rz, int, dim, skin = d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9] local ped = createPed ( skin, x, y, z ) setElementRotation ( ped, rx, ry, rz ) setElementInterior ( ped, int ) setElementDimension ( ped, dim ) setElementFrozen ( ped, true ) setElementData ( ped, "modelka", true ) local marker = createMarker ( x + 1, y, z, "cylinder", 1, 255, 51, 255, 50 ) addEventHandler ( "onPlayerMarkerHit", marker, function ( hitMarker ) outputChatBox ( "test" ) if ( hitMarker == marker ) then if ( isElement ( source ) and getElementType ( source ) == "player" ) then outputChatBox ( "test1" ) podejmijPrace ( source, skin ) end end end ) end end )
-
Add a matching animation on pressing down arrow to make players slip down the hurdles, by following: onClientKey -- When he presses key (down_arrow in this case). setControlState -- Disable moving backwards. [url=https://wiki.multitheftauto.com/wiki/Control_names]https://wiki.multitheftauto.com/wiki/Control_names[/url] setPedAnimation -- Set a slipping animation. -- And a function to move ped while slipping down the hurdles, can also be done within the animations. Note that disabling backwards control will make ped not move backwards but on pressing down arrow, ped will still trigger the onClientKey event and there you can add checks to move ped while slipping down the hurdles.
-
g_LocalPlayer = getLocalPlayer() g_Root = getRootElement() g_ThisResource = getThisResource() g_ResourceRoot = getResourceRootElement(getThisResource()) chat = {} -- table to store chat windows in newmsg = {show=false, tick=getTickCount(), showtime=5000, img=nil, lbl=nil } -- new msg table anims = {} function buildPlayerList() local x,y = guiGetScreenSize() local width,height = 175,350 x = x-width y = (y-height)/2 --newmsg.img = guiCreateStaticImage(681.0000,134.0000, 42.0000,34.0000, "image/chat-icon.png", false) -- mail message icon newmsg.lbl = guiCreateLabel(553.0000,175.0000, 244.0000, 19.0000, "", false) guiLabelSetColor(newmsg.lbl,0, 170, 255) guiLabelSetHorizontalAlign(newmsg.lbl, "right", true) guiSetAlpha(newmsg.img, 0) --guiSetAlpha(newmsg.lbl, 0) wndPlayers = guiCreateWindow(1140,256,222,343, "MTATR.com Mesaj Sistemi", false) --fond = guiCreateMemo(0.0405,0.0525,0.9189,0.9213,"",true,wndPlayers) grdPlayers = guiCreateGridList(0,0.10,3,2, true, wndPlayers) colPlayers = guiGridListAddColumn(grdPlayers, "Oyuncular", 0.85) local players = getElementsByType("player") for k,v in ipairs(players) do addPlayerToList(v) end guiSetProperty(fond,"Disabled","true") guiWindowSetSizable(wndPlayers, false) guiSetProperty(wndPlayers, "RollUpEnabled", "true") guiSetProperty(wndPlayers, "Dragable", "true") guiSetAlpha(wndPlayers, 0) -- create animations for it anims.plfadein = Animation.create(wndPlayers, Animation.presets.guiFadeIn(1000)) anims.plfadeout = Animation.create(wndPlayers, Animation.presets.guiFadeOut(1000)) anims.nmfadein = Animation.create(newmsg.img, Animation.presets.guiFadeIn(1000)) anims.nmfadeout = Animation.create(newmsg.img, Animation.presets.guiFadeOut(1000)) anims.nmtextin = Animation.create(newmsg.lbl, Animation.presets.guiFadeIn(1000)) anims.nmtextout = Animation.create(newmsg.lbl, Animation.presets.guiFadeOut(1000)) --[[ local x,y = guiGetPosition(newmsg.img) outputDebugString("guigetPostions: " ..tostring(x).." "..tostring(y)) local scrx,scry = guiGetScreenSize() anims.nmslidein = Animation.create(newmsg.img, Animation.presets.guiMove(x,y))--, 1000,false, scrx,scry, false)) anims.nmslideout = Animation.create(newmsg.img, Animation.presets.guiMove(scrx,scry))--, 1000,false, x,y, false)) ]] bindKey("F4", "down", togglePmGui) end function addPlayerToList(ply) --outputDebugString("addPlayerToList:" ..getPlayerName(ply)) local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(ply) guiGridListSetItemText(grdPlayers,row,colPlayers, name, false, false) --guiGridListSetItemText ( grdPlayers, row, colPlayers, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false) end function removeColorCoding ( str ) assert(str, type(str)=="string", "Invalid argument @ removeColorCoding. Expected 'string', got '"..type(str).."'.") while str:find("#%x%x%x%x%x%x") do str = str:gsub ( "#%x%x%x%x%x%x", "" ) end return str end function showPmGui(state) if state == true then anims.plfadein:play() for k,v in pairs(chat) do guiSetVisible(chat[k].wnd,true) end showCursor(true) elseif state == false then anims.plfadeout:play() for k,v in pairs(chat) do guiSetVisible(chat[k].wnd,false) end showCursor(false) guiSetInputEnabled(false) end end function togglePmGui() if not anims.plfadein:isPlaying() and not anims.plfadeout:isPlaying() then if guiGetAlpha(wndPlayers) > .1 then showPmGui(false) else showPmGui(true) end end end function buildChatWindow(ply) local x,y = guiGetScreenSize() local width,height = 300,250 x = x*.5 y = y*.5 chat[ply] = {} chat[ply].wnd = guiCreateWindow(337,277,395,252, getPlayerName(ply), false) --chat[ply].img = guiCreateStaticImage(0.0228,0.0754,0.9544,0.8889,"image/shruk.png",true,chat[ply].wnd) chat[ply].memo = guiCreateMemo(0.043,0.1746,0.9089,0.623, "", true, chat[ply].wnd) chat[ply].edit = guiCreateEdit(0.043,0.8214,0.7089,0.1111, "", true, chat[ply].wnd) chat[ply].btnX = guiCreateButton(0.9215,0.0754,0.0557,0.0794, "X", true, chat[ply].wnd) chat[ply].btnSend = guiCreateButton(0.757,0.8135,0.2127,0.1429, "Gonder", true, chat[ply].wnd) guiSetProperty(chat[ply].img,"Disabled","true") guiMemoSetReadOnly(chat[ply].memo, true) guiWindowSetSizable(chat[ply].wnd, false) guiSetProperty(chat[ply].wnd, "RollUpEnabled", "true") guiSetProperty(chat[ply].wnd, "Dragable", "true") if anims.plfadein:isPlaying() then-- in process of fading in guiSetVisible(chat[ply].wnd, true) elseif anims.plfadeout:isPlaying() then -- in process of fading out guiSetVisible(chat[ply].wnd, false) else -- not in process of either if guiGetAlpha(wndPlayers) > .1 then guiSetVisible(chat[ply].wnd, true) -- is showing else guiSetVisible(chat[ply].wnd, false) -- isnt showing end end end function destroyChatWindow(ply) if chat[ply] and isElement(chat[ply].wnd) then destroyElement(chat[ply].wnd) chat[ply] = nil end end function sendChatMessage(ply) --outputDebugString("sendChatMessage: " .. tostring(ply)) if chat[ply] and isElement(chat[ply].wnd) then local newText = guiGetText(chat[ply].edit) if newText and string.len(newText) > 0 then local oldText = guiGetText(chat[ply].memo) if not oldText then oldText = "" end oldText = oldText .. removeColorCoding(getPlayerName(g_LocalPlayer)) .. ": " .. newText .. "\n" --Line 154 guiSetText(chat[ply].memo, oldText) guiSetText(chat[ply].edit, "") guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) triggerServerEvent("onGUIPrivateMessage", g_LocalPlayer, ply,newText) end end end function recieveChatMessage(ply, msg) --outputDebugString("recieveChatMessage: " .. msg) if not chat[ply] then buildChatWindow(ply) end newmsg.show = true newmsg.tick = getTickCount() ---guiSetText(newmsg.lbl, getPlayerName(ply) .. ": " .. msg .. "\n") guiSetText(newmsg.lbl, " Message from " .. getPlayerName(ply) .. "\n") outputChatBox("F4 Mesaj Geldi",255,0,0,true) local sound = playSound("GatkResalh~.mp3",false) setSoundVolume(sound, 0.2) anims.nmfadein:play() anims.nmtextin:play() --anims.nmslidein:play() local oldText = guiGetText(chat[ply].memo) if not oldText then oldText = "" end oldText = oldText .. removeColorCoding(getPlayerName(ply)) .. ": " .. msg .. "\n" --Line 180 guiSetText(chat[ply].memo, oldText) guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) end event_resource_start = function(res) buildPlayerList() end event_resource_stop = function(res) unbindKey("F3", "down", togglePmGui) showPmGui(false) end event_player_join = function() --outputDebugString("onClientPlayerJoin") addPlayerToList(source) end event_player_quit = function() --outputDebugString("onClientPlayerQuit") removePlayerFromList(source) destroyChatWindow(source) end event_gui_click = function(button, state, absx, absy) if button == "left" and state == "up" then if getElementType(source) == "gui-button" then local parent = getElementParent(source) if parent ~= false then local ply = getPlayerFromName(guiGetText(parent)) if ply then if source == chat[ply].btnX then destroyChatWindow(ply) guiSetInputEnabled(false) elseif source == chat[ply].btnSend then sendChatMessage(ply) guiSetInputEnabled(false) end end end elseif getElementType(source) == "gui-edit" then local parent = getElementParent(source) if parent ~= false then local ply = getPlayerFromName(guiGetText(parent)) if source == chat[ply].edit then guiSetInputEnabled(true) end end else guiSetInputEnabled(false) end end end event_gui_doubleclick = function(button, state, absx, absy) if button == "left" and state == "up" then if source == grdPlayers then local row, col = guiGridListGetSelectedItem(grdPlayers) --outputDebugString("double clicked row: "..tostring(row)) if row == -1 or col == -1 then return end local name = guiGridListGetItemText(grdPlayers, row, col) local ply = getPlayerFromName(name) if not chat[ply] then buildChatWindow(ply) end guiBringToFront(chat[ply].wnd) end end end event_gui_accepted = function(element)
-
Check out the wiki topics: https://wiki.multitheftauto.com/wiki/Se ... _functions https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL
-
Hmm good for starter, agar koi help chahiye ho to mujhay batana.
-
Well in that case, it's a bit hard due to wired desync happens sometimes randomly because of ped not handling functions attached to it completely. But you can try these functions: setPedLookAt or setPedAimTarget And build up a function to fire the aimed target, manually.
-
Check out my post regarding SQLite vs MySQL: https://forum.multitheftauto.com/viewtopic.php?f ... 42#p772442 Also, @xXMADEXx if i'm not wrong, a MySQL connection can also be obtained online (apart from offline XAMPP, etc) by having a free domain from any free webhost right? Like hostinger or 00webhost.
-
Thanks... Welcomed.
-
EDIT : Arsam also from Lahore Done... aap ka name no.12 pehlay se hi roster main tha, with name: Moeez Khan, maine update kar diya hai.
-
Ab aap dekho main isey kesay active rakhta hoon, aur thanks for compliment
-
In that case, you'll have to learn database a bit, then loop through mta's default database and that too, contains protected forms of passwords, i guess that protection is called md5 or something:
-
Uhm, no offense, i don't wanna talk rudely here but that ages old resource given here was completely not like mine. Plus, i ain't giving out open source resources just because i wanna spread random-repeated-shit in here, i am actually giving PHP Source files too so that people should actually learn from it. Check my signature: - Live weather app = NEVER Introduced before in MTA, can be used for real weather sync with game one. - Voice Messaging = NEVER introduced before, the MTA Voice system is completely different thing. Anyways, if you don't wanna see this resource, better stay out instead of criticizing random people who actually spent their time thinking that they can help newbies in learning webpage interactions. Anyways, thanks for the opinion anyways
-
There are so many tables-in-tables which makes confusions for filling up the GUI elements which might be the issue.
-
Thanks for passing that piece of information, MHS.
-
Mujhay kal remind karwana main set kar doon ga.
-
Wo maine kuch mahinay pehlay hi dekha tha, change kar deta hoon btw.
-
You're welcome, MHS. I'd always be pleased to share more resources to see such replies Thank you.
-
Walykum Assalam, MHS. Help me update the new roster viewtopic.php?f=178&t=86440 agar aap ko kuch friends ki information pata hai (City/Server) mujhay udher batao main update kar doonga.
-
Pakistani Roster Name Ali Saml1er Mr.ShariQ Ryan Bilal135 S.K Raahim Robin.. Arsam Lampard Evil# TheSmart Saim Hero MHS OptimusP City Karachi Unknown Islamabad Islamabad Faisalabad Bannu Karachi Lahore Lahore Unknown Lahore Lahore Unknown Rawalpindi Unknown Specialty(s) LUA LUA LUA/Mapper LUA/PHP/C++/JS/SQL/more... LUA/Mapper None LUA LUA/Mapper/PHP/DOS/more... None None None LUA/Mapper LUA LUA/Mapper Mapper Server(s) Unknown DDC MR:RPG CIT2 GTW Unknown NEG PGFR/DM/FFS/TG/Prototype DM Unknown N/A CSRG EgO-Team N/A 3R Help me keep this updated, give me required information: Name: City: Speciality: Server(s): * Iss post ko sahi tarha dekhney ke liye "User Control Panel" kholain > Board preferences ki tab kholain > Yahan "My Board Style" ke samnay walay combobox main "Landing" ki jaga "wide_landing" select karain aur submit karain, ab ye post sahi show ho gi.
-
Yaar aap log yahan par to active raho kam se kam...
-
Koi baat nahi, jaldi kaam ho jaye ga aap ka Edit as of April, 15th: I would like to be elected as Urdu section moderator, i am 24/7 active here as i don't play on any server for now so i can manage it decently.
-
There, try this: function setHandling() for index, player in pairs(getElementsByType('player') do bindKey(player, "k", function() for i, veh in ipairs(getElementsByType("vehicle") do if getElementModel(veh) == 451 then setVehicleHandling(veh, "mass", 1600) setVehicleHandling(veh, "turnMass", 3921.3) setVehicleHandling(veh, "dragCoeff", 1.8 ) setVehicleHandling(veh, "centerOfMass", { 0, -0.4, 0 } ) setVehicleHandling(veh, "percentSubmerged", 75) setVehicleHandling(veh, "tractionMultiplier", 0.75) setVehicleHandling(veh, "tractionLoss", 0.85) setVehicleHandling(veh, "tractionBias", 0.52) setVehicleHandling(veh, "numberOfGears", 5) setVehicleHandling(veh, "maxVelocity", 200) setVehicleHandling(veh, "engineAcceleration", 8.8 ) setVehicleHandling(veh, "engineInertia", 10) setVehicleHandling(veh, "driveType", "rwd") setVehicleHandling(veh, "engineType", "petrol") setVehicleHandling(veh, "brakeDeceleration", 10) setVehicleHandling(veh, "brakeBias", 0.53) setVehicleHandling(veh, "ABS", 0) setVehicleHandling(veh, "steeringLock", 35) setVehicleHandling(veh, "suspensionForceLevel", 1.3) setVehicleHandling(veh, "suspensionDamping", 0.12) setVehicleHandling(veh, "suspensionHighSpeedDamping", 0) setVehicleHandling(veh, "suspensionUpperLimit", 0.28 ) setVehicleHandling(veh, "suspensionLowerLimit", -0.12) setVehicleHandling(veh, "suspensionFrontRearBias", 0.38 ) setVehicleHandling(veh, "suspensionAntiDiveMultiplier", 0) setVehicleHandling(veh, "seatOffsetDistance", 0.2) setVehicleHandling(veh, "collisionDamageMultiplier", 0.24) setVehicleHandling(veh, "monetary", 25000) setVehicleHandling(veh, "modelFlags", 0x40000000) setVehicleHandling(veh, "handlingFlags", 0x10200008 ) setVehicleHandling(veh, "headLight", 0) setVehicleHandling(veh, "tailLight", 1) setVehicleHandling(veh, "animGroup", 0) end end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), setHandling)
-
Hmmm, maybe server admins want to use reset password feature within game? Though, its just a minor resource.
-
I think he is not going to update these, i'll make a new, more detailed topic soon... --- nvm double post, i've made an updated topic: viewtopic.php?f=178&t=86440
-
Why don't you try fetching account name from serverside? like in server part add this: local acc = getAccountName(getPlayerAccount(source)) I prefer this one because its the better way instead of using element data.