Jump to content

fmj02

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by fmj02

  1. fmj02

    Unban request

    I got banned globally(master server) on serial. I admit I hacked(used my own little hack to test how good anti cheat is xD, injected my own Lua script through hooking some calls... well, it worked for a while). Could I ask for unbanning? I regret.. it won't happen again. Your anti cheat is beast Serial: 15AA4B3B92F1332AFB4F5C84E79D2752 Best regards
  2. Display name changing option is missing, it was available before. Would be nice to see it again under "Edit profile".
  3. viewtopic.php?f=140&t=38462&hilit=scene2res
  4. Skrypt jest zakładam server-side, więc w pliku określającym zasób wiesz co masz robić. Druga sprawa: callback onPlayerChat przyjmuje dwa parametry nimi są: message, messageType. W systemie zdarzeń MTA istnieje coś takiego jak source czyli podmiot do którego jest dane zdarzenie przypisane. Zamień więc sobie: local function czat (message, thePlayer) na local function czat (message, messageType) oraz wszystkie thePlayer na source, no i tyle. Co do specyfikatora local to nie wiem czy on jest szybszy, parser interpretuje kod podobnie, taka różnica, że local jest dostępny tylko w danym zakresie, a global "wszędzie". Moim zdaniem to też możesz wyjebać. Also czytaj wiki, jak coś nie działa to kod jest po prostu nie zjebany ale źle napisany. https://wiki.multitheftauto.com/wiki/OnPlayerChat EDIT: jeszcze błąd skrawkiem oka zobaczyłem: elseif (money<=price) then Nie pozwalasz kupić przedmiotu gdy twój stan pieniędzy jest niższy lub równy cenie towaru. Problem w słowie równy, skoro twoja kasa jest równa cenie czyli cie na to stać więc zamień <= na < chociaż to i tak nie istotne bo sprawdzasz czy jest równy w pierwszym warunku ale to tak tylko pisze. btw. zorientowałem sie, że odkopałem w chuj stary temat , ale przynajmniej problem solved.
  5. http://www.gtamodding.com/index.php?tit ... t_Adjuster
  6. Use your minutes variable, for this reason it's created... isn't it? [...] local minutes = math.floor(time * 60 * 1000) outputChatBox(getPlayerName(target).." has been muted for "..tostring(((minutes/1000)/60)).." minutes ("..reason..") .", root,255, 0, 0) setPlayerMuted(target, true) setTimer(setPlayerMuted, minutes, 1, target, false) [...] Best regards.
  7. So in this case you should consider using OnClientResourceStart
  8. He will be muted for ever because there's no timer in your code executing function which is responsible for unmute, outputChatBox displays 24 minutes because variable minutes contains this value. Currently it works like that: 4*60*1000 so minutes is equal to 240000 right now - your 4 minutes in milliseconds, so if you want to display it as minutes you've got to divide it by 1000 and then by 60. outputChatBox(getPlayerName(target).." has been muted for "..tostring(((minutes/1000)/60))).." minutes ("..reason..") .", root,255, 0, 0) Except this you should use setTimer to actually get it working. setTimer
  9. STRING datatype doesn't exist in SQLite, consider using TEXT instead of it. http://www.sqlite.org/datatype3.html Best regards.
  10. Your code isn't working properly because of two things: 1. You can't call the functions just when you specify arguments of some function(tostring in this case). 2. local variables are accessible only "before first end" after if statement they're not visible anymore so when you try to use them UH OH code doesn't work. so all you have is to remove local keywords and tostring from the arguments instead of using it there use it inside. function callphonenumber(thePlayer, cmd, phonenumber2, ...) if phonenumber2 then phonenumber2 = tostring(phonenumber2) -- PHONENUMBER2 if (phonenumber2 == "222222222") then player2 = getPlayerFromName("Ervin_Balog") elseif (phonenumber2 == "755167267") then player2 = getPlayerFromName("Alex_James") elseif (phonenumber2 == "752786786") then player2 = getPlayerFromName("John_Skot") elseif (phonenumber2 == "756842354") then player2 = getPlayerFromName("Bohumil_Jentky") end -- PHONENUMBER1 if (getPlayerName(thePlayer) == "Ervin_Balog") then phonenumber1 = "222222222" elseif (getPlayerName(thePlayer) == "Alex_James") then phonenumber1 = "755167267" elseif (getPlayerName(thePlayer) == "John_Skot") then phonenumber1 = "752786786" elseif (getPlayerName(thePlayer) == "Bohumil_Jentky") then phonenumber1 = "756842354" end if player2 and phonenumber1 then local msg = table.concat({...}, " ") if (msg and msg ~= "") then outputChatBox("[PHONE-"..phonenumber1.."]: ".. msg .." ",player2,255,150,30,true) outputChatBox("Message has been sent.",thePlayer,255,150,30,true) end end end end addCommandHandler("phone",callphonenumber) Try to test code below to understand it better: console outputs nil function test(a) if a then local myLocal = 5 end print(myLocal) end test(1) Best regards
  11. That's fantastic! I can give you code for sex I made long time ago for my rp server needs, but it's really easy to make though. That would be a good script for communities, imagine that in this camera view. I want to see more.
  12. You will have to remove auto-respawn to make it working, otherwise the team will be always alive(if the server has players) function AreSurvivorsGone() local t = {} for _, v in ipairs(getPlayersInTeam(teamSurvivor)) do if isPedDead(v) then table.insert(t, v) end end if #t == getPlayersInTeam(teamSurvivor) then return true end return false end addEventHandler("onPlayerWasted", root, function() if AreSurvivorsGone() then -- function for changing the map end end )
  13. You haven't even set zombie team, why do you expect it to work? Now when you die, you are zombie and after 5 seconds you get spawned with the knife and new skin. If it doesn't work just check error logs, I just modified few lines. local aa_root = getRootElement() teamSurvivor = createTeam ( "Humans", 0, 255, 0 ) teamZombies = createTeam ( "Zombies", 255, 0, 0 ) function loadmap(startmap, player) mapRoot = getResourceRootElement(startmap) local plrs = getElementsByType( "player" ); for i, plr in pairs( plrs ) do setElementData( plr, "Deaths", 0 ) -- ////////////////// MISION \\\\\\\\\\\\\\\\\\ local total_markers = getElementChildrenCount( getElementByID( "markers" ) ) local num = math.random( 0, total_markers - 1 ) local marker_spawn = getElementChild ( getElementByID( "markers" ), num) local mx = getElementData ( marker_spawn, "posX" ) local my = getElementData ( marker_spawn, "posY" ) local mz = getElementData ( marker_spawn, "posZ" ) setPlayerTeam ( plr, teamSurvivor ) objectiveMarker = createMarker(mx, my, mz) -- ///////////////// SPAWN \\\\\\\\\\\\\\\\\\\\ local total_spawns = getElementChildrenCount( getElementByID( "spawns" ) ) local num = math.random( 0, total_spawns - 1 ) local spawn_random = getElementChild ( getElementByID( "spawns" ), num ) local x = getElementData ( spawn_random, "posX" ) local y = getElementData ( spawn_random, "posY" ) local z = getElementData ( spawn_random, "posZ" ) local rot = getElementData ( spawn_random, "rot" ) setTimer( setPedSkin , 500 , 1 , plr, math.random(9,288)) spawnPlayer( plr, x, y, z, rot); setCameraTarget ( plr, plr ); fadeCamera( plr, true ); for k,v in ipairs( getElementChildren( getElementByID( "armas" ) ) ) do giveWeapon( plr, tonumber( getElementData( v, "id" ) ), getElementData( v, "ammo" ) ) end end end addEventHandler("onGamemodeMapStart", aa_root, loadmap) function aa_onResourceStart( resourcename, res ) setTeamFriendlyFire(teamSurvivor , false ) if ( resourcename == getThisResource () ) then local plrs = getElementsByType( "player" ); for i, plr in pairs( plrs ) do setElementData( plr, "Deaths", 0 ) end setTimer( call, 1000, 1, getResourceFromName("scoreboard"), "addScoreboardColumn", "Deaths" ) end if resourceName == 'mapmanager' then mapmanager = createResourceCallInterface('mapmanager') end end addEventHandler( "onResourceStart", aa_root, aa_onResourceStart ) function joinHandler() local total_spawns = getElementChildrenCount( getElementByID( "spawns" ) ) local num = math.random( 0, total_spawns - 1 ) local spawn_random = getElementChild ( getElementByID( "spawns" ), num ) local x = getElementData ( spawn_random, "posX" ) local y = getElementData ( spawn_random, "posY" ) local z = getElementData ( spawn_random, "posZ" ) local rot = getElementData ( spawn_random, "rot" ) setElementData( source, "inmarker", false ); setPlayerTeam ( source, teamSurvivor ) spawnPlayer( source, x, y, z, rot ) setTimer( setPedSkin , 500 , 1 , source, math.random(9,288)) outputChatBox("< Welcome To Against All By CHAOS_IS_ME>", source, 255, 138, 0, true) outputChatBox("< Current Version: #00FF00 1.0>", source, 255, 138, 0, true) setCameraTarget ( source, source ) setElementData( source, "Deaths", 0 ) fadeCamera(source, true) for k,v in ipairs( getElementChildren( getElementByID( "armas" ) ) ) do giveWeapon( source, tonumber( getElementData( v, "id" ) ), getElementData( v, "ammo" ) ) end end addEventHandler("onPlayerJoin", aa_root, joinHandler) function aa_playerWasted( totalAmmo, killer ) local playerdeaths = getElementData ( source, "Deaths" ) setElementData ( source, "Deaths", playerdeaths+1 ) local total_spawns = getElementChildrenCount( getElementByID( "spawns" ) ) local num = math.random( 0, total_spawns - 1 ) local skin = math.random(9,288) local spawn_random = getElementChild ( getElementByID( "spawns" ), num ) local x = getElementData ( spawn_random, "posX" ) local y = getElementData ( spawn_random, "posY" ) local z = getElementData ( spawn_random, "posZ" ) local rot = getElementData ( spawn_random, "rot" ) setPlayerTeam ( source, teamZombies ) setTimer( spawnPlayer , 5000 , 1 , source, x, y, z, rot) setCameraTarget ( source, source ) fadeCamera(source, true) --[[ idk what the fuck is dat for k,v in ipairs( getElementChildren( getElementByID( "armas" ) ) ) do setTimer( giveWeapon, 5000 , 1 , source, tonumber( getElementData( v, "id" ) ), getElementData( v, "ammo" ) ) end]] end addEventHandler ( "onPlayerWasted", aa_root, aa_playerWasted ) local localPlayerName = getPlayerName(aa_root) -- misiones function MarkerHit1 ( hitPlayer, matchingDimension ) local plrs = getElementsByType( "player" ); for i, plr in pairs( plrs ) do WinDisplay = textCreateDisplay () setTimer( textDisplayAddText, 800, 1, WinDisplay, WinText ) -- textDisplayAddText ( WinDisplay, WinText ) WinText = textCreateTextItem ( getPlayerName(hitPlayer) .. " WIN! Next Map In 10 Seconds", 0.5, 0.5, "low", 255, 0, 0, 255, 2, "center" ) textDisplayAddObserver ( WinDisplay, plr) setElementData( hitPlayer, "inmarker", true ) setTimer( textDestroyTextItem, 5000, 1, WinText ) setTimer(StartNextMap,10000,1) setPedFrozen ( aa_root, true ) setTimer( setElementFrozen, 10000, 1, aa_root, false ) end end addEventHandler("onMarkerHit", aa_root, MarkerHit1) function StartNextMap () exports.mapmanager:changeGamemode( getResourceFromName('aa') ) end infection = createPickup (-1, 1, 3.11, 3, 1275, 15000 ) function infected ( thePlayer ) setPlayerTeam ( thePlayer, teamZombies ) setPedSkin ( thePlayer, 13 ) setPedHeadless ( thePlayer, true ) end addEventHandler ( "onPickupUse", infection, infected ) addEventHandler("onPlayerSpawn", root, function() if(getPlayerTeam(source) == teamZombies) then local weaponsToGive = { { id = 4, ammo = 30, setAsCurrent = true }, -- your knife } for _, v in ipairs(weaponsToGive) do giveWeapon(source, v.id, v.ammo, v.setAsCurrent) end setElementModel(source, 137) setPedHeadless ( source, true ) outputChatBox ( "You are now a Zombie.", source, 255, 0, 0 ) end end )
  14. It works 100%, you had to make something wrong. Please upload somewhere your code because it's too big to post it here.
  15. Maybe you have a resource with the same event turned on.. like freeroam? According to this example it should work well.
  16. It doesn't matter, even at the bottom.
  17. Sets a skin and gives knife. addEventHandler("onPlayerSpawn", root, function() if(getPlayerTeam(source) == teamZombies) then local weaponsToGive = { { id = 4, ammo = 30, setAsCurrent = true }, -- your knife } for _, v in ipairs(weaponsToGive) do giveWeapon(source, v.id, v.ammo, v.setAsCurrent) end setElementModel(source, 137) end end )
  18. You can't share variables, only functions using call or exports.resource:exportedFunction(...) this is the only way, to allow calling from other resource you have to export it first in meta. Here is more. EDIT: you can try to make a function getVariables that will return _G table and export it.
  19. There is a loop in this code which gives weapons to elements with id "armas", the id of those elements was set with setElementID, so just set the id and make same loop. That could be done easier, the code of this gamemode is ugly.
  20. So just change the order guiSetVisible(backo.bg, true) guiSetVisible(backo.panel, true) guiBringToFront (backo.panel)
  21. Your gamemode is simple, just make two teams named humans and zombies or whatever and use the setPlayerTeam to assign new player to humans when he/she dies then onPlayerWasted is called, so just change the team on zombies, make a table containing the weapons and skins for each team and assign them inside onPlayerSpawn checking the team with getPlayerTeam, to make a round system just make a function named endRound and set the timer to call it after some time. You don't need a map for that, if you want to disallow zombies picking some pickup just use cancelEvent in OnPickupHit also using getPlayerTeam. It's all possible with just few functions. Don't go off the deep end, it's hard to make own gamemode if it's your first language ever.
  22. It should work, make sure the screen position is correct and the image really exists. function login() local backo = { panel = guiCreateStaticImage(0.34, 0.28, 0.30, 0.40, "login/li/pnl.png", true), bg = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "login/li/lobbyBG.png", true) } guiSetVisible(backo.panel, true) guiSetVisible(backo.bg, true) showCursor (true) end addCommandHandler("system2",login)
  23. addEventHandler ( "onPlayerWasted", root, function ( ) local x,y,z = 0,0,0 -- your position to spawn player spawnPlayer( source, x, y, z, 0, 137 ) outputChatBox ( "You are now a Zombie.", source, 255, 0, 0 ) end )
  24. guiSetVisible(backo.panel, true) guiSetVisible(backo.bg, true)
  25. You better show your code instead of ineffective trying to describe this problem.
×
×
  • Create New...