Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. like here is the code but there is a bug: the weapon passes through the body in some skins if you sit down the weapon above his head: D even if you fell the same. as a glue gun to the body so if you like jumping a weapon too, and so on? function player_Spawn ( ) skin = getElementModel ( source ) notrolley = getAttachedElements ( source ) for k,v in pairs(notrolley) do if getElementType ( v ) == "object" then destroyElement ( v ) end end local x,y,z = getElementPosition ( source ) waepon = createObject ( 356, x, y, z, 0, 0, 0 ) attachElements ( waepon, source, -0.1, -0.20, 0.35, 0.000000, 45.000000, 0 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) function player_Quit ( ) notrolley = getAttachedElements ( source ) for k,v in pairs(notrolley) do if getElementType ( v ) == "object" then destroyElement ( v ) end end end addEventHandler ( "onPlayerQuit", getRootElement(), player_Quit ) screens lol
  2. now wanted to make the script carry weapons on his back but when jumping and falling etc weapon moves that need to make the weapon was secured to the body normally? screen http://funkyimg.com/u2/404/547/mta-scre ... -25-23.png bug http://funkyimg.com/viewer.php?img=/2/6 ... -35-17.png
  3. I did not realize you want to do what only you can open the door?
  4. Kenix

    [help] error

    if teamSurvivor ~= winner then setCameraTarget(teamSurvivor,winner)
  5. Kenix

    [help] error

    not working zombies won! teamSurvivor = createTeam ( "Survivors", 0, 255, 0 ) teamzombie = createTeam ( "Zombies", 255, 0, 0 ) g_Root = getRootElement() local g_TimeLimit,g_MissionTimer local mapTimers = {} local announcementText local defaults = { timeLimit = 300, } local function sortingfunction (a,b) return (getElementData(a,"Score") or 0) > (getElementData(b,"Score") or 0) end function zmMapStart(resource,mapRoot) local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end addEventHandler ( "onGamemodeMapStart", g_Root, zmMapStart ) addEventHandler ( "onPlayerJoin", g_Root, function() if announcementText then announcementText:sync(source) end end) function Endgame(winner,draw) for i,timer in ipairs(mapTimers) do if isTimer ( timer ) then killTimer ( timer ) end end outputChatBox ( "debug; 2;" ) mapTimers = {} destroyElement(g_MissionTimer) setTimer ( reboot, 6100, 1 ) if not winner then if draw then for i,player in ipairs(getElementsByType("player")) do -- add ( ) toggleAllControls(player,true,true,false) fadeCamera(player,false,10,0,0,0) end outputChatBox ( "debug; 3;" ) triggerClientEvent ( "onzombiewin", getRootElement()) outputChatBox("Выживших не осталось. Зомби победили!") announcementText:visible(true) announcementText:text("Выживших не осталось. Зомби победили!") announcementText:color(255,255,255,255) announcementText:sync() return else return end end outputChatBox ( "debug; 4;" ) for i,player in ipairs(getElementsByType("player")) do -- add ( ) if Survivors~= winner then -- changed setCameraTarget(player,winner) toggleAllControls(player,true,true,false) end fadeCamera(player,false,10,0,0,0) end outputChatBox ( "debug; 5;" ) triggerClientEvent ( "onsurwin", getRootElement()) outputChatBox("Выжившие победили! Они пережили нападение") announcementText:visible(true) announcementText:text(getTeamName(winner).."Выжившие победили! Они пережили нападение") announcementText:color(getTeamColor(winner)) announcementText:sync() outputChatBox ( "debug; wintext;" ) end function reboot() announcementText:visible(false) announcementText:sync() exports.mapmanager:changeGamemode( getResourceFromName('zombie_mod') ) end function isTimer ( timer ) for i,v in ipairs(getTimers()) do if timer == v then return true end end outputChatBox ( "debug; 7;" ) return false end function onTimeElapsed() local teamSurvivor = getElementsByType("team") -- you were getting same teams in both tables table.sort ( teamSurvivor, sortingfunction ) -- sortingFunction i suppose if getElementData ( teamSurvivor[1], "Score" ) == getElementData ( teamSurvivor[2], "Score" ) then Endgame(false, true) -- your "draw" return end Endgame(teamSurvivor[1],false) -- send the team with most points to Endgame() function end
  6. Kenix

    GUI images

    on the screen do you mean? if not then the coordinates are needed in any way: D
  7. Kenix

    [help] error

    Hasn't understood.
  8. Kenix

    [help] error

    I've corrected the script but it still does not work = ( still zombies win = ( teamSurvivor = createTeam ( "Survivors", 0, 255, 0 ) teamzombie = createTeam ( "Zombies", 255, 0, 0 ) g_Root = getRootElement() local g_TimeLimit,g_MissionTimer local mapTimers = {} local announcementText local defaults = { timeLimit = 300, } local function sortingfunction (a,b) return (getElementData(a,"Score") or 0) > (getElementData(b,"Score") or 0) end function zmMapStart(resource,mapRoot) local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end addEventHandler ( "onGamemodeMapStart", g_Root, zmMapStart ) addEventHandler ( "onPlayerJoin", g_Root, function() if announcementText then announcementText:sync(source) end end) function Endgame(winner,draw) for i,timer in ipairs(mapTimers) do if isTimer ( timer ) then killTimer ( timer ) end end outputChatBox ( "debug; 2;" ) mapTimers = {} destroyElement(g_MissionTimer) setTimer ( reboot, 6100, 1 ) if not winner then if draw then for i,player in ipairs(getElementsByType("player")) do -- add ( ) toggleAllControls(player,true,true,false) fadeCamera(player,false,10,0,0,0) end outputChatBox ( "debug; 3;" ) triggerClientEvent ( "onzombiewin", getRootElement()) outputChatBox("Выживших не осталось. Зомби победили!") announcementText:visible(true) announcementText:text("Выживших не осталось. Зомби победили!") announcementText:color(255,255,255,255) announcementText:sync() return else return end end outputChatBox ( "debug; 4;" ) for i,player in ipairs(getElementsByType("player")) do -- add ( ) if player ~= winner then -- fix setCameraTarget(player,winner) toggleAllControls(player,true,true,false) end fadeCamera(player,false,10,0,0,0) end outputChatBox ( "debug; 5;" ) triggerClientEvent ( "onsurwin", getRootElement()) outputChatBox("Выжившие победили! Они пережили нападение") announcementText:visible(true) announcementText:text(getTeamName(winner).."Выжившие победили! Они пережили нападение") announcementText:color(getTeamColor(winner)) announcementText:sync() outputChatBox ( "debug; wintext;" ) end function reboot() announcementText:visible(false) announcementText:sync() exports.mapmanager:changeGamemode( getResourceFromName('zombie_mod') ) end function isTimer ( timer ) for i,v in ipairs(getTimers()) do if timer == v then return true end end outputChatBox ( "debug; 7;" ) return false end function onTimeElapsed() local teamSurvivor = getElementsByType("team") -- you were getting same teams in both tables table.sort ( teamSurvivor, sortingfunction ) -- sortingFunction i suppose if getElementData ( teamSurvivor[1], "Score" ) == getElementData ( teamSurvivor[2], "Score" ) then Endgame(false, true) -- your "draw" return end Endgame(teamSurvivor[1],false) -- send the team with most points to Endgame() function end
  9. Kenix

    [help] error

    Thanks already helped the timer works and shows who won and start next map, but now the bug only team wins zombie. but it must be right if the surviving are kept, they win. P.s many thanks dude)
  10. Kenix

    [help] error

    Question : announcementText is not a function, it's an object. answer : I was mistaken it I know Question : whole onTimeElapsed() function is almost random code. answer: Read more attentively. addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) Question : what is sortingfunction? answer: local function sortingFunction (a,b) return (getElementData(a,"Score") or 0) > (getElementData(b,"Score") or 0) end and it looks like you dont really know what you're doing. answer : I want to make that was shown team which won. The zombie or survived.
  11. Kenix

    [help] error

    That it for an error help to solve it. not work function onTimeElapsed() and announcementText ERROR: attempt to compare two userdata values. teamSurvivor = createTeam ( "Survivors", 0, 255, 0 ) teamzombie = createTeam ( "Zombies", 255, 0, 0 ) g_Root = getRootElement() local g_TimeLimit,g_MissionTimer local mapTimers = {} local announcementText local defaults = { timeLimit = 300, } function zmMapStart(resource,mapRoot) local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end addEventHandler ( "onGamemodeMapStart", g_Root, zmMapStart ) addEventHandler ( "onPlayerJoin", g_Root, function() if announcementText then announcementText:sync(source) end end) function Endgame(winner,draw) for i,timer in ipairs(mapTimers) do if isTimer ( timer ) then killTimer ( timer ) end end outputChatBox ( "debug; 2;" ) mapTimers = {} destroyElement(g_MissionTimer) setTimer ( reboot, 1000, 1 ) if not winner then if draw then for i,player in ipairs(getElementsByType"player") do toggleAllControls(player,true,true,false) fadeCamera(player,false,10,0,0,0) end outputChatBox ( "debug; 3;" ) triggerClientEvent ( "onzombiewin", getRootElement()) outputChatBox("Выживших не осталось. Зомби победили!") announcementText:visible(true) announcementText:text("Выживших не осталось. Зомби победили!") announcementText:color(255,255,255,255) announcementText:sync() return else return end end outputChatBox ( "debug; 4;" ) for i,player in ipairs(getElementsByType"player") do if team ~= winner then setCameraTarget(player,winner) toggleAllControls(player,true,true,false) end fadeCamera(player,false,10,0,0,0) end outputChatBox ( "debug; 5;" ) triggerClientEvent ( "onsurwin", getRootElement()) outputChatBox("Выжившие победили! Они пережили нападение") announcementText:visible(true) announcementText:text(getTeamName(winner).."Выжившие победили! Они пережили нападение") announcementText:color(getTeamColor(winner)) announcementText:sync() outputChatBox ( "debug; wintext;" ) end function reboot() announcementText:visible(false) announcementText:sync() exports.mapmanager:changeGamemode( getResourceFromName('zombie_mod') ) end function isTimer ( timer ) for i,v in ipairs(getTimers()) do if timer == v then return true end end outputChatBox ( "debug; 7;" ) return false end function onTimeElapsed() local teamSurvivor = getElementsByType"team" local teamzombie = getElementsByType"team" table.sort ( teamSurvivor, sortingfunction ) table.sort ( teamzombie, sortingfunction ) if getElementData ( teamSurvivor,teamzombie[1], "Score" ) == getElementData ( teamSurvivor,teamzombie[2], "Score" ) then Endgame ( false, true ) return end Endgame(teamSurvivor,teamzombie[1],false) end
  12. https://community.multitheftauto.com/index.php?p= ... ls&id=1517 It enrages me!!! Why they don't understand that upload It is impossible. You are right XX3.
  13. https://community.multitheftauto.com/index.php?p= ... ls&id=1493
  14. I here have made a script but it doesn't work. = ( help me please. Here my script g_Root = getRootElement() local g_TimeLimit,g_MissionTimer local mapTimers = {} local defaults = { timeLimit = 300, } function zmMapStart(resource,mapRoot) local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 end addEventHandler ( "onGamemodeMapStart", g_Root, zmMapStart ) function startGame() g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end function Endgame(winner,draw) for i,timer in ipairs(mapTimers) do if isTimer ( timer ) then killTimer ( timer ) end end mapTimers = {} destroyElement(g_MissionTimer) setTimer ( reboot, 15000, 1 ) if not winner then if draw then for i,player in ipairs(getElementsByType"player") do toggleAllControls(player,true,true,false) exports.scoreboard:setPlayerScoreboardForced ( player, true ) fadeCamera(player,false,10,0,0,0) end local zombwintextDis = textCreateDisplay () local zombwiitem = textCreateTextItem(getTeamName(winner).."Выживших не осталось. Зомби победили!", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( zombwitextDis, zombwiitem ) textDisplayAddObserver ( zombwitextDis, source ) setTimer ( textDestroyTextItem, 4000, 1, zombwiitem ) setTimer ( textDestroyDisplay, 4000, 1, zombwitextDis ) return else return end end for i,player in ipairs(getElementsByType"player") do if player ~= winner then setCameraTarget(player,winner) toggleAllControls(player,true,true,false) end exports.scoreboard:setPlayerScoreboardForced ( player, true ) fadeCamera(player,false,10,0,0,0) end local surwintextDis = textCreateDisplay () local surwinitem = textCreateTextItem(getTeamName(winner).."Выжившие победили! Они пережили нападение", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( surwintextDis, surwinitem ) textDisplayAddObserver ( surwintextDis, source ) setTimer ( textDestroyTextItem, 4000, 1, surwinitem ) setTimer ( textDestroyDisplay, 4000, 1, surwintextDis ) end function reboot() for i,player in ipairs(getElementsByType"player") do exports.scoreboard:setPlayerScoreboardForced ( player, false ) end zmMapStart(g_MapResource,g_MapRoot) end function isTimer ( timer ) for i,v in ipairs(getTimers()) do if timer == v then return true end end return false end no errors in debugscript.
  15. https://community.multitheftauto.com/ind ... ls&id=1477
  16. https://community.multitheftauto.com/index.php?p= ... ls&id=1378
  17. I can help at me there are sounds of shots from css and textures the weapons the new.
  18. Help please I want to make a round from what to me to begin? I want to make round time, the round end (what team has won) and after that joins next map.
  19. Thanks the dude the enormous!!!!!!!!!!!!!!!!!
  20. I have made a script that when the player dies at it there is other weather but it works on all players. How to make that it worked only on one player??? server addEventHandler( "onPlayerWasted", getRootElement( ), function() triggerClientEvent ("playerw", getRootElement()) end ) client localPlayer = getLocalPlayer() addEvent("playerw",true) addEventHandler( "playerw", localPlayer, function( ) setSkyGradient (100,50,0,70,0,0); end ) Please help to correct my script.=(
  21. I have corrected a script of errors wasn't present but all the same not spawn. local fa_root = getRootElement() teamSurvivor = createTeam ( "Survivors", 0, 255, 0 ) teamzombie = createTeam ( "Zombies", 255, 0, 0 ) setTeamFriendlyFire( teamSurvivor, false ) setTeamFriendlyFire( teamzombie, false ) function startzmMap( startedMap ) -- startedMap e la mappa appena avviata mapRoot = source local mapRoot = getResourceRootElement( startedMap ) local xi, yi, zi = 0, 0, 0 local spawns = table.merge(getElementsByType("spawnpoint",mapRoot),getElementsByType("spawnpoint2",mapRoot),getElementsByType("spawnpoint1",mapRoot)) for i,spawnpoint in ipairs(spawns) do getElementData( spawnpoint, "posX" ) getElementData( spawnpoint, "posY" ) getElementData( spawnpoint, "posZ" ) end end addEventHandler("onGamemodeMapStart", getRootElement(), startzmMap) function zm_onResourceStart( resourcename, res ) setTeamFriendlyFire(Survivors , false ) setTeamFriendlyFire(Zombies , 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("dxscoreboard"), "addScoreboardColumn", "Deaths" ) end if resourceName == 'mapmanager' then mapmanager = createResourceCallInterface('mapmanager') end end addEventHandler( "onResourceStart", fa_root, zm_onResourceStart ) function joinPlayer ( ) setPlayerTeam ( source, Survivors ) giveWeapon ( source, 14, 100 ) end addEventHandler ( "onPlayerJoin", getRootElement(), joinPlayer ) function aa_playerWasted( totalAmmo, killer ) setPlayerTeam ( source, Zombies ) giveWeapon ( source, 4, 1 ) end addEventHandler ( "onPlayerWasted", aa_root, aa_playerWasted ) function table.merge(appendTo, ...) -- table.merge(targetTable, table1, table2, ...) -- Append the values of one or more tables to a target table. -- -- In the arguments list, a table pointer can be followed by a -- numeric or textual key. In that case the values in the table -- will be assumed to be tables, and of each of these the value -- corresponding to the given key will be appended instead of the -- subtable itself. local appendval for i=1,arg.n do if type(arg[i]) == 'table' then for k,v in pairs(arg[i]) do if arg[i+1] and type(arg[i+1]) ~= 'table' then appendval = v[arg[i+1]] else appendval = v end if appendval then if type(k) == 'number' then table.insert(appendTo, appendval) else appendTo[k] = appendval end end end end end return appendTo end
×
×
  • Create New...