Jump to content

Search the Community

Showing results for tags 'help'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. How to change the chat position?
  2. I was building my map in editor (it was working) and suddenly when i was testing it and try to open it i saw black screen and cant open it in editor
  3. Guys, how do i play MTA:SA without gta? I really want to play the game! Isnt there a different way to play it without gta:sa?
  4. i downloaded a jail script from community, and when i add me to a jail, i can access the F1 how to disable fr gui in jail? server: Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) anims = { "F_smklean_loop", "M_smklean_loop", "M_smkstnd_loop", "M_smk_drag", "M_smk_in", "M_smk_loop", "M_smk_out", "M_smk_tap" , } function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("** #FFFF00You Jailed [ "..getPlayerName(thePlayer).." #FFFF00] at "..theJail[1].." For "..time,source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Jailed By [ "..getPlayerName(source).." #FFFF00] at "..theJail[1].." For "..time,thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Jailed For "..time,root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Please Select Time !",source,255,0,0,true) end else outputChatBox("** #FFFF00Please Select a Jail !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00You Released [ "..getPlayerName(thePlayer).." #FFFF00]",source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Released by [ "..getPlayerName(source).." #FFFF00]",thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Released ",root,255,0,0,true) setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Time Left : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimer:~(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ :p function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimer:~(plr,timer,time) -- to sort timer's :~ .. if timer and time then if isTimer(timer:~Timer) then killTimer(timer:~Timer) end timer:~Timer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timer:~Timer) then killTimer(timer:~Timer) end end function onTimerFinish(Player) -- on timer end stopJailTimer(Player) triggerEvent("onJailEnd",Player,Player) end client: lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) setElementData(lp,"jailed",false) ------ addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getDataz",lp,lp) end ) desz = {} addEvent("sendDataz",true) addEventHandler("sendDataz",root,function(jTable,tTable) ------ jWin = guiCreateWindow(460,172,445,416,"Jail System v2.1",false) --- Center Window --- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(jWin,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(jWin,x,y,false) ----- Center Window ----- guiSetVisible(jWin,false) guiWindowSetSizable(jWin,false) ------------------------- jBut = guiCreateButton(247,338,167,31,"Jail Him",false,jWin) tGrid = guiCreateGridList(240,184,190,144,false,jWin) guiGridListSetSelectionMode(tGrid,0) ------- -- sEdit = guiCreateEdit(14,380,217,23,"Search ..",false,jWin) -- -------- local timeC = guiGridListAddColumn( tGrid, "Time", 0.85 ) if timeC then for k,v in ipairs ( tTable ) do local time = v[1] local des = v[2] local row = guiGridListAddRow ( tGrid ) desz[row] = des guiGridListSetItemText ( tGrid, row, timeC, time.." "..des, false, true ) end local row = guiGridListAddRow ( tGrid ) guiGridListSetItemText ( tGrid, row, timeC,"Other ..", false, true ) end -------- jGrid = guiCreateGridList(240,31,190,144,false,jWin) guiGridListSetSelectionMode(jGrid,0) -------- local jailC = guiGridListAddColumn( jGrid, "Jail", 0.85 ) for k,v in ipairs ( jTable ) do local name = v[1] local row = guiGridListAddRow ( jGrid ) guiGridListSetItemText ( jGrid, row, jailC, name, false, false ) end jcBut = guiCreateButton(246,378,172,24,"Close",false,jWin) function jailShow () guiSetVisible(jWin,not guiGetVisible ( jWin ) ) showCursor(guiGetVisible ( jWin ) ) guiSetInputEnabled(guiGetVisible ( jWin ) ) destroyElement(pList) -- Players List pList = guiCreateGridList(14,31,218,338,false,jWin) column = guiGridListAddColumn( pList, "Player", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end -- Players List end addEvent("jailShow",true) addEventHandler("jailShow",root,jailShow) function changeText(button,state,x,y) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) local thePlr = getPlayerFromName(sPlayer) if thePlr then local isJailed = getElementData(thePlr,"jailed") if isJailed == false then guiSetText(jBut,"Jail Him") elseif isJailed == true then guiSetText(jBut,"Release Him") end end end addEventHandler("onClientGUIClick",root,changeText) function onClick (button, state, absoluteX, absoluteY) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) jail = guiGridListGetItemText ( jGrid, guiGridListGetSelectedItem ( jGrid ), 1 ) time = guiGridListGetItemText ( tGrid, guiGridListGetSelectedItem ( tGrid ), 1 ) timeDes = tostring(desz[guiGridListGetSelectedItem ( tGrid )]) if ( source == jBut ) then if guiGetText(jBut) == "Jail Him" then if time ~= "Other .." then triggerServerEvent("JailHimx",lp,sPlayer,jail,time,timeDes) else createTimeSelect(sPlayer,jail) end elseif guiGetText(jBut) == "Release Him" then triggerServerEvent("unJailHim",lp,sPlayer) end ---------- elseif ( source == jcBut ) then guiSetVisible (jWin, false) showCursor (false) guiSetInputEnabled(false) end end addEventHandler( "onClientGUIClick", root, onClick ) ------------ end ) addEventHandler("onClientPlayerDamage",root,function(at) if getElementData(source,"jailed") == true then if at then cancelEvent() end end end ) ------- addEventHandler("onClientGUIClick",root,function() if source == sEdit then guiSetText(sEdit,"") --[[ else guiSetText(sEdit,"Search ..") --]] end end ) addEventHandler("onClientGUIChanged",root,function() if source == sEdit then ------ guiGridListClear(pList) for k,v in ipairs ( getElementsByType("player") ) do local name = string.lower(getPlayerName(v)) if name then if string.find (name,string.lower(guiGetText(sEdit)) ) then row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( v ), false, false ) end end end end ------ end ) ------ function createTimeSelect(theJailed,theJail) if not tostring(theJailed) then outputChatBox("** #FFFF00Please Select a Player !",255,0,0,true) return end if not tostring(theJail) then outputChatBox("** #FFFF00Please Select a Jail !",255,0,0,true) return end if isElement(TimeSelect_Window) then return end TimeSelect_Window = guiCreateWindow(550,397,270,125,"Enter Time",false) -- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(TimeSelect_Window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(TimeSelect_Window,x,y,false) -- -- guiSetVisible(jWin,false) -- TimeSelect_Edit = guiCreateEdit(15,37,89,26,"",false,TimeSelect_Window) TimeSelect_Label = guiCreateLabel(110,41,10,15,"in",false,TimeSelect_Window) TimeSelect_Grid = guiCreateGridList(126,31,130,95,false,TimeSelect_Window) guiGridListSetSelectionMode(TimeSelect_Grid,2) --- column = guiGridListAddColumn( TimeSelect_Grid, "", 0.80 ) r1 = guiGridListAddRow(TimeSelect_Grid) r2 = guiGridListAddRow(TimeSelect_Grid) r3 = guiGridListAddRow(TimeSelect_Grid) guiGridListSetItemText ( TimeSelect_Grid , r1, column, "Hours", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r2, column,"Minutes", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r3, column, "Seconds", false, false ) TimeSelect_Button = guiCreateButton(14,72,91,40,"OK",false,TimeSelect_Window) -- function onOk() if source == TimeSelect_Button then -- removeEventHandler("onClientGUIClick",root,onOk) -- ---------------- theTime = guiGetText(TimeSelect_Edit) timeType = guiGridListGetItemText ( TimeSelect_Grid, guiGridListGetSelectedItem ( TimeSelect_Grid ) ) -- destroyElement(TimeSelect_Window) jailShow () -- if tonumber(theTime) then if tostring(timeType) then triggerServerEvent("JailHimx",lp,theJailed,theJail,theTime.." "..timeType,timeType,true) else outputChatBox("** #FFFF00Please Select , Hours or Minutes or Seconds !",255,0,0,true) end else outputChatBox("** #FFFF00Please Enter a Number !",255,0,0,true) end ---------------- end end addEventHandler("onClientGUIClick",root,onOk) end
  5. First of all, sorry for bad English. I am creating a script and I used the getElementData function to get data stored in the user account and then the setElementData function to get the information through the getElementData on the client but the script has the following error in debugging: Bad argument @ setElementData [Expect element at argument 1, got nil] SCRIPT: [SERVER-SIDE] function setarDados_Entrar(source) local acc = getPlayerAccount(source) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(source, "hblt", habl)--In that error line setElementData(source, "fich", ficha) -- In that error line end function setarDados_Iniciar() local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end function setarDados_Mudar(player) local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end addEventHandler("onPlayerLogin", getRootElement(), setarDados_Entrar) addEventHandler("onResourceStart", root, setarDados_Iniciar) addEventHandler("onAccountDataChange", root, setarDados_Mudar)
  6. function adminDutyStart() local result = mysql:query("SELECT id, name FROM factions WHERE type >= 2 ORDER BY id ASC") local max = mysql:query("SELECT id FROM duty_allowed ORDER BY id DESC LIMIT 0, 1") if result and max then dutyAllow = { } dutyAllowChanges = { } i = 0 local maxrow = mysql:fetch_assoc(max) maxIndex = tonumber(maxrow.id) or 0 while true do local row = mysql:fetch_assoc(result) if not row then break end table.insert(dutyAllow, { row.id, row.name, { --[[Duty information]] } }) i = i+1 local result1 = mysql:query("SELECT * FROM duty_allowed WHERE faction="..tonumber(row.id)) if result1 then while true do local row1 = mysql:fetch_assoc(result1) if not row1 then break end table.insert(dutyAllow[i][3], { row1.id, tonumber(row1.itemID), row1.itemValue }) end end end setElementData(resourceRoot, "maxIndex", maxIndex) setElementData(resourceRoot, "dutyAllowTable", dutyAllow) mysql:free_result(result) mysql:free_result(result1) mysql:free_result(max) else outputDebugString("[Factions] ERROR: Duty allow permissions failed.") end end addEventHandler("onResourceStart", resourceRoot, adminDutyStart)--]] Line 9 - 10
  7. I know there are many errors but I can not solve them... Help me please.
  8. السلام عليكم ورحمة الله وبركاتة | كيف حال الشباب ان شاء الله بخير انا اليوم وانا عادل على مودات لاحظت زر لا هو اكس دي ولا ايش مدري ما له صورة ولا شي كنت بدي اغير مكانو بس ما عرفت ممكن مساعدة اكواد الزر التي تم ايجادها local MainMenu = { {"Go",true,255,255,255}, {"Kill",false,255,255,255}, } لو تشرحولي وش نوع الزر ذا وتشرحولي كيف التعديل عليه وألخ .. بكون ممتن لكم كثيررر ارجو الرد السريع
  9. function Window () painel = guiCreateWindow(286, 231, 454, 345, "VIP BSA", true) guiWindowSetSizable(painel, true) showCursor ( true ) myWindow = guiCreateStaticImage(9, 19, 435, 316, "123.png", false, painel) button1 = guiCreateButton(0, 229, 140, 49, "Skin VIP", false, myWindow) button2 = guiCreateButton(150, 229, 140, 49, "Carro VIP", false, myWindow) button3 = guiCreateButton(295, 229, 140, 49, "Habilidades", false, myWindow) button4 = guiCreateButton(347, 46, 78, 32, "Fechar", false, myWindow) guiSetAlpha(button1, 0.20) guiSetAlpha(button2, 0.20) guiSetAlpha(button3, 0.20) guiSetAlpha(button4, 0.20) if ( guiGetVisible ( Window ) == true ) then guiSetVisible ( painel,Window, false ) showCursor ( false ) else guiSetVisible ( painel,Window, true ) showCursor ( true ) end end addCommandHandler ("vip", Window, painel, myWindow) --------------------------------------------- addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == button1) then local player = getLocalPlayer() setElementModel ( source, 230 ) outputChatBox ('#000000[#00ffffVoce Acaba De Pega Skin#000000] !',source,255,255,255,true) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == button2) then local player = getLocalPlayer() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(411, x,y,z + 2) outputChatBox ('#000000[#00ffffVoce Acaba De Criar Um Carro#000000] !',source,255,255,255,true) warpPedIntoVehicle (source,veh[source]) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == button3) then local player = getLocalPlayer() local stat = getPedStat ( source, 1 ) -- Check that getPedStat returned a value if ( stat > 1000 ) then outputChatBox ('#000000[#00ffffVoce Pegou Habilidades#000000]!',source,255,255,255,true) end end ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function ( ) if (source == button4) then local player = getLocalPlayer() guiSetVisible( myWindow, false ) showCursor( false ) guiSetVisible( myWindow, false ) showCursor( false ) end end )
  10. Hello everyone, I've been scouring the gta forum links but unfortunately I could not find this farce. What is my problem? Well my problem is that I already learned to do basically everything but my interior gets extremely dark in the game. Explanation I use Google SketchUp to draw and texturize my models .. then expropt like 3ds. So I get to use 3ds max to get my dff file and col. And I use G-TXD to get my txd. And then I create the script to replace (replaceModel) and there I go in the game and everything works correctly but it is not clear Print
  11. Hey, MTA forum. I just started playing MTA:SA again on my new PC. When I joined a race, one map loaded where i could see nothing but purple fog. I assumed it was just part of the map or perhaps that one was bugged. No other maps had that problem. Later, I joined a freeroam server. There were no issues. I left that one for the default MTA:SA server. It was fine for a few minutes, and then suddenly, everything is covered in dark green fog. What the hell? I don't see anyone complaining, so I assume it's only on my end. Anyone ever have this problem? If so, know how to fix it? Ty! <3
  12. Hello there Humans , a week or 2 ago i downloaded a resource from the resource community (https://community.multitheftauto.com/index.php?p=resources), And it's a Groundpickups resource, it was outdated, like bugs appeared when i started using it and testing it, i thought by myself, let's fix these render bugs and outdated functions, alright, about 1 week later i got it fixed, i uploaded it to the resource community, BAM.. no problem!.. But like an hour or 2 later, ccw (an administrator) suspended it, while it's nearly the same piece of code like as that of GroundPickups, and i look'd at the reason why it got suspended, well.. 'CallServerFunction' was that reason why it got suspended!. And then i thought by myself, well.. if this is insecure against hackers and such, then why is the original GroundPickups not suspended (i send a message about it to ccw, he suspended it now). But, now the following thing is, i now want to secure the 'callServerFunction', But i don't even know and never used this type of function's before, so now to anyone who wil help me out, thanks for the help, Now the script itself, i've try'ed some stuff and to merge the example's of 'callServerFunction' into the groundpickups script, but without success >.< (There's 1 Export in the meta.xml, just for the info it's: <export function = "createGroundWeapon" type = "server" /> ) So this is the script right before i started trying to add a secure method for this function: client.lua (Client-Side Script): screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution shrifteg = (0.015 * screenHeight) / 9 localPlayer = getLocalPlayer() currentGround = nil elementgg = {} gta4markers = true weaponmarkercolors = { [0] = {255,255,255}, [1] = {100,100,255}, [2] = {0,230,0}, [3] = {0,150,0}, [4] = {255,255,0}, [5] = {255,204,0}, [6] = {150,0,150}, [7] = {255,0,255}, [8] = {0,0,255}, [9] = {204,255,255}, [10] = {255,100,100}, [11] = {255,255,255}, [12] = {255,255,255} } slots = { [1] = 0, [2] = 1,[3] = 1,[4] = 1,[5] = 1,[6] = 1,[7] = 1,[8] = 1,[9] = 1, [24] = 2,[23] = 2,[22] = 2, [25] = 3,[26] = 3,[27] = 3, [29] = 4,[32] = 4,[28] = 4, [30] = 5,[31] = 5, [33] = 6,[34] = 6, [35] = 7,[36] = 7,[37] = 7,[38] = 7, [16] = 8,[17] = 8,[18] = 8,[39] = 8, [41] = 9,[42] = 9,[43] = 9, [10] = 10,[11] = 10,[12] = 10,[13] = 10,[14] = 10,[15] = 10, [44] = 11,[45] = 11,[46] = 11, [40] = 12 } weaponsIDS = { --0 [1] = 331, --1 [2] = 333, [3] = 334, [4] = 335, [5] = 336, [6] = 337, [7] = 338, [8] = 339, [9] = 341, --2 [22] = 346, [23] = 347, [24] = 348, --3 [25] = 349, [26] = 350, [27] = 351, --4 [28] = 352, [29] = 353, [32] = 372, --5 [30] = 355, [31] = 356, --6 [33] = 357, [34] = 358, --7 [35] = 359, [36] = 360, [37] = 361, [38] = 362, --8 [16] = 342, [17] = 343, [18] = 344, [39] = 363, --9 [41] = 365, [42] = 366, [43] = 367, --10 [10] = 321, [11] = 322, [12] = 323, [13] = 324, [14] = 325, [15] = 326, --11 [44] = 368, [45] = 369, [46] = 371, --12 [40] = 364 } function client_createGroundWeapon(groundweapon) if(elementgg[groundweapon] == nil) then local temp = createColSphere(tonumber(getElementData(groundweapon, "posX")),tonumber(getElementData(groundweapon, "posY")),tonumber(getElementData(groundweapon, "posZ"))+0.5, 1) --[[local temp = createColCuboid(tonumber(getElementData(groundweapon, "posX"))-0.5, tonumber(getElementData(groundweapon, "posY"))-0.5, tonumber(getElementData(groundweapon, "posZ"))-1, 1,1,2)]] setElementData(temp, "colshape.groundweapon", groundweapon) setElementData(temp, "colshape.weaponid", tonumber(getElementData(groundweapon, "weaponid"))) setElementData(temp, "colshape.ammo", tonumber(getElementData(groundweapon, "ammo"))) setElementData(temp, "colshape.clip", tonumber(getElementData(groundweapon, "clip"))) elementgg[groundweapon] = temp local slot = slots[tonumber(getElementData(groundweapon, "weaponid"))] --createObject local object = createObject(weaponsIDS[tonumber(getElementData(groundweapon, "weaponid"))], tonumber(getElementData(groundweapon, "posX")),tonumber(getElementData(groundweapon, "posY")),tonumber(getElementData(groundweapon, "posZ")), tonumber(getElementData(groundweapon, "rotX")),tonumber(getElementData(groundweapon, "rotY")),tonumber(getElementData(groundweapon, "rotZ"))) setObjectStatic(object, true) setElementCollisionsEnabled(object, false) setElementInterior(object, tonumber(getElementData(groundweapon, "interior"))) setElementDimension(object, tonumber(getElementData(groundweapon, "dimension"))) setElementData(temp, "colshape.object", object) --createMarker local marker = createMarker(tonumber(getElementData(groundweapon, "posX")), tonumber(getElementData(groundweapon, "posY")), tonumber(getElementData(groundweapon, "posZ"))+0.05, "corona", 0.5, weaponmarkercolors[slot][1],weaponmarkercolors[slot][2], weaponmarkercolors[slot][3], 20) setElementInterior(marker, tonumber(getElementData(groundweapon, "interior"))) setElementDimension(marker, tonumber(getElementData(groundweapon, "dimension"))) setElementData(temp, "colshape.marker", marker) local x,y,z = getElementPosition(localPlayer) if(getDistanceBetweenPoints2D(x,y,tonumber(getElementData(groundweapon, "posX")),tonumber(getElementData(groundweapon, "posY"))) < 0.25) then local_activate(temp, localPlayer,true) end end end function client_destroyGroundWeapon(groundweapon) local col = elementgg[groundweapon] local object = getElementData(col, "colshape.object") local marker = getElementData(col, "colshape.marker") if(isElement(object)) then destroyElement(object) end if(isElement(marker)) then destroyElement(marker) end if(isElement(col)) then destroyElement(col) end elementgg[groundweapon] = nil end function pickupCurrentWeapon() if(isElement(currentGround)) then local weaponid = getElementData(currentGround, "colshape.weaponid") local ammo = getElementData(currentGround, "colshape.ammo") local clip = getElementData(currentGround, "colshape.clip") if(getPedWeapon(localPlayer, slots[weaponid]) ~= 0) then dropWeapon(slots[weaponid]) end if(ammo) then local groundweapon = getElementData(currentGround, "colshape.groundweapon") callServerFunction("destroyElement", groundweapon) callServerFunction("giveWeapon", localPlayer, weaponid, ammo, true) callServerFunction("setWeaponAmmo", localPlayer, weaponid, ammo, clip) for i,p in ipairs(getElementsByType("colshape")) do if(isElementWithinColShape(localPlayer, p) == true) then local_activate(p, localPlayer,true) else if( not isElementWithinColShape(localPlayer, p) ) then break end end end end end end function dropWeapon(slot) if(slot > 0) then local weaponid = getPedWeapon(localPlayer, slot) if(weaponid ~= 0) then callServerFunction("takeWeapon", localPlayer, weaponid) local x,y,z = getElementPosition(localPlayer) local hit, hitX, hitY, hitZ, as = processLineOfSight(x, y, z, x, y, -3000, true, false, false, true, false, false, false, false) if(hit) then z = hitZ else z = z - 0.95 end callServerFunction("createGroundWeapon", weaponid, getPedTotalAmmo(localPlayer), getPedAmmoInClip(localPlayer), x,y,z, 97.3,120,math.random(0,359),getElementInterior(localPlayer),getElementDimension(localPlayer)) end end end function local_activate(shape, element,dimension) if(element == localPlayer) then --local groundweapon = getElementData(shape, "colshape.groundweapon") --local object = getElementData(shape, "colshape.object") --local marker = getElementData(shape, "colshape.marker") currentGround = shape end end addEventHandler("onClientResourceStart", getRootElement(), function(startedRes) if(startedRes == getThisResource()) then bindKey("k", "down", "pickup/swap weapon") bindKey("l", "down", "drop weapon") else for i,p in pairs(getElementsByType("groundweapon")) do --getResourceRootElement(startedRes) client_createGroundWeapon(p) end end end ) addEventHandler("onClientResourceStop", getResourceRootElement(), function(startedRes) for i,p in pairs(getElementsByType("groundweapon")) do client_destroyGroundWeapon(p) end end ) addEventHandler("onClientRender", getRootElement(), function() if(isElement(currentGround)) then local weaponid = getElementData(currentGround, "colshape.weaponid") local ammo = getElementData(currentGround, "colshape.ammo") sx,sy = screenWidth/2, screenHeight/2 local str = "false" dxDrawRectangle(sx-80, sy-20, 160, 75, tocolor(0, 0, 0, 128)) if(getPedWeapon(localPlayer, slots[weaponid]) ~= 0) then str = "swap weapons" dxDrawImage(sx-13, sy+13, 26, 26, "img/swap.png") dxDrawImage(sx+20, sy-10, 50, 50, "img/" .. weaponid .. ".png") dxDrawImage(sx-70, sy-10, 50, 50, "img/" .. getPedWeapon(localPlayer, slots[weaponid]) .. ".png") dxDrawText(tostring(ammo), sx+45, sy+45, sx+45, sy+45, tocolor(255,255,255,255), 1, "default-bold", "center", "center") dxDrawText(tostring(getPedTotalAmmo(localPlayer, slots[weaponid])) .. " (you)", sx-45, sy+45, sx-45, sy+45, tocolor(255,255,255,255), 1, "default-bold", "center", "center") else str = "pickup weapon" dxDrawImage(sx-25, sy-10, 50, 50, "img/" .. tonumber(weaponid) .. ".png") dxDrawText(tostring(ammo), sx, sy+45, sx, sy+45, tocolor(255,255,255,255), 1, "default-bold", "center", "center") end dxDrawText("Use 'k' to " .. str, sx, sy-20, sx, sy-20, tocolor(255,255,50,255), 1, "default-bold", "center", "center") end end ) addEventHandler("onClientPlayerWasted", localPlayer, function() dropWeapon(getPedWeaponSlot(localPlayer)) end ) addEventHandler("onClientElementDestroy", getRootElement(), function() if(getElementType(source) == "groundweapon") then client_destroyGroundWeapon(source) end end ) addEventHandler("onClientColShapeHit", getResourceRootElement(), function(element,dimension) local_activate(source, element,dimension) end ) addEventHandler("onClientColShapeLeave", getResourceRootElement(), function(element,dimension) if(element == localPlayer) then currentGround = nil for i,p in ipairs(getElementsByType("colshape")) do if(isElementWithinColShape(localPlayer, p) == true) then local_activate(p, localPlayer,true) else if( not isElementWithinColShape(localPlayer, p) ) then break end end end end end ) addCommandHandler("pickup/swap weapon", function() pickupCurrentWeapon() end) addCommandHandler("drop weapon", function() dropWeapon(slots[getPedWeapon(localPlayer)]) end) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the serverside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction) server.lua (Server-Side Script): function createGroundWeapon(weaponid, ammo, clip, posX, posY, posZ, rotX, rotY, rotZ, interior, dimension) local temp = createElement("groundweapon") setElementData(temp, "weaponid", weaponid) setElementData(temp, "ammo", ammo) setElementData(temp, "clip", clip) setElementData(temp, "posX", posX) setElementData(temp, "posY", posY) setElementData(temp, "posZ", posZ) setElementData(temp, "rotX", rotX) setElementData(temp, "rotY", rotY) setElementData(temp, "rotZ", rotZ) setElementData(temp, "interior", interior) setElementData(temp, "dimension", dimension) for i,p in ipairs(getElementsByType("player")) do callClientFunction(p, "client_createGroundWeapon", temp) end return temp end addEventHandler("onResourceStop", getResourceRootElement(), function(startedRes) if(startedRes == getThisResource()) then for i,p in pairs(getElementsByType("groundweapon")) do destroyElement(p) end end end ) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end Like always, Thanks for any Answers and/or Solutions you people come up with!.. Gr.xboxxxxd EDIT: If you want to, just make it in someway possible to replace all the call function's into events or somthing,
  13. function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox ("#FF0000* #00FF00You have sucessfuly registered! [Username: #FFFFFF" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","An unknown error has occured! Please choose a different username/password and try again.") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","An account with this username already exists!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Passwords do not match!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please confirm your password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter a password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter a username you would like to register with!") end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) wheni press the register key the debug says that the resource can't add account as in : local accountAdded = addAccount(tostring(username),tostring(password))
  14. Hi Everyone! Can someone help me, how can I make that, if a fire is created it outputs the chatbox the fire's position (example: "The LSPD is on fire" or "The Hospital is on fire" . The Script Files: FireC.lua local fireElement = {} addEvent("FireServer.rootFireCreate",true) addEventHandler("FireServer.rootFireCreate",getRootElement(),function(rand) local fire = createFire(FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3], FirePositions[rand][4], FirePositions[rand][5], FirePositions[rand][6]) fireElement[#fireElement + 1] = fire end) addEventHandler ("onClientResourceStart", getRootElement(), function (res) if res ~= getThisResource() then return end triggerServerEvent("FireServer.loadMe", localPlayer, localPlayer) end) function draw() for k,v in ipairs(getElementsByType("object")) do if getElementData(v, "Fire->object") then local x, y ,z = getElementPosition(v) local wx, wy, wz = getScreenFromWorldPosition(x , y, z+1) if wx and wy then local playerx, playery, playerz = getElementPosition(getLocalPlayer()) if getDistanceBetweenPoints3D(playerx, playery, playerz, wx, wy, wz) <= 5 then dxDrawRectangle(wx-200/2,wy,200,30,tocolor(0,0,0,255/2)) dxDrawRectangle(wx-200/2+5,wy+5,190,20,tocolor(124, 197, 118,255/2)) end end end end end addEventHandler("onClientRender", root, draw) FireG.lua FirePositions = { -- X, Y, Z, Range(FireSize) [1] = {2114.1240234375, -1756.2508544922, 13.3984375, 800}, } FireS.lua local loadedPlayers = {} local fireBar = {} FireServer = {} function FireServer.start(player) loadedPlayers[#loadedPlayers + 1] = player end addEvent("FireServer.loadMe", true) addEventHandler("FireServer.loadMe", root, FireServer.start) function FireServer.FireCreate() if math.random(1, 3) == 2 then local rand = math.random(#FirePositions) if fireBar[rand] then return end for k,v in pairs(loadedPlayers) do triggerClientEvent(v, "FireServer.rootFireCreate", v, rand) fireBar[rand] = createObject(1337, FirePositions[rand][1], FirePositions[rand][2], FirePositions[rand][3] - 1) setElementAlpha(fireBar[rand], 0) setElementCollisionsEnabled(fireBar[rand], false) setElementData(fireBar[rand], "Fire->object", true) end end end setTimer(FireServer.FireCreate, 1000, 0)
  15. Hi everyone! Can someone help me that, if I click on specified object, then run a function named "startit1"
  16. Guest

    Wasted script

    Can someone help me out with script ? I need script that when my player dies it will show WASTED text like in original GTA san andreas
  17. Guest

    Just a question

    Hello , I have a question . How to get this coordinates in mta san andreas ? - mx, my, mz, tarx, tary, tarz , rot
  18. Guest

    Need help,

    Hello , I have quick question. How to add more weapon properties ?? Because when I try to add flag 0x000010 it doesn't work. So how ? addEventHandler("onResourceStart", resourceRoot, -- resourceRoot == the resource that just started (this resource) function () setWeaponProperty("ak-47", "poor", "flags", 0x000020) end)
  19. Anthony

    help

    bindKey("F1", "down", function() if getElementData(localPlayer,"Stats") < 2 and getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then if not isInColExport () then guiSetVisible(Window_VS, not guiGetVisible(Window_VS)) guiSetVisible (Window_CHK, false) showCursor(guiGetVisible(Window_VS)) end end end) triggerServerEvent("onOpenGui", localPlayer) what's the wrong at this script supports English and Arabic help
  20. I need a scripter for my Turkish Roleplay Server project.Req: - Must know UCP scripting.- Must do what I wantContact :Phone : +905386809975Steam : Dr.RushmeSkype : live:emrah_butuk01Instagram : benimadimjesus(I need a webmaster too :P)
  21. I need a scripter for my Turkish Roleplay Server project. Req: - Must know UCP scripting. - Must do what I want Contact : Phone : +905386809975 Steam : Dr.Rushme Skype : live:emrah_butuk01 Instagram : benimadimjesus (I need a webmaster too :P)
  22. i have this code: setTimer(function() local arfolyam = math.random(200,5130) outputChatBox("Jelenlegi árfolyam: "..arfolyam) end, 500, 0) GUIEditor.window[1] = guiCreateWindow(0.35, 0.31, 0.31, 0.28, "Aranykereskedés", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(0.02, 0.59, 0.95, 0.14, "Az arany jelenlegi árfolyama: "..arfolyam, true, GUIEditor.window[1]) but i get this error in debugscript 3: attempt to concatenate global 'arfolyam' ( a nil value) what wrong? how to fix this?
  23. Guest

    Map Editor not working properly

    Greetings community, My Map Editor started throw a error in console but when I connect to server it is all loaded up but I am missing that bottom left bar and editor wont load any map so I cant edit map or create new ones. So then I saw error in console "ERROR: edf\edf.lua:220: editor_main: couldn't load edf file" But I dont make changes to edf file... So I dont know why it start throwing that error. Can someone help me with this? Thanks and have a good day or night (Idk what time it is in your country...) :).
  24. i got this error, but the script working fine... -.- bad argument #1 to 'len' (string expected, got boolean) how to fix this? code: function currentSongName() local radio_title = getElementData(resourceRoot, "radio.title") if string.len(radio_title) >= x*0.0625 then radio_title = string.sub(radio_title, 1, 80)..".." end for i, shading in pairs ( offsetShadings ) do dxDrawText("Radio: "..radio_title, xD+shading[1], yD+shading[2], xD, yD+textHeight, tocolor ( 0, 0, 0, 255 ), scale, font, "left", "center", false, false, true, true) end dxDrawText("Radio: #ffffff"..radio_title, xD, yD, xD, yD+textHeight, tocolor ( 70, 215, 0, 255 ), scale, font, "left", "center", false, false, true, true) end addEventHandler('onClientRender', root, currentSongName)
  25. Is there an event that runs when the player changes weapons or looks like this?
×
×
  • Create New...