-
Posts
419 -
Joined
-
Last visited
-
Days Won
1
Everything posted by nikitafloy
-
Thx for u remarks. But now every player hears music. Need to hear it was only from the source. And now playing some URL, if I change the station.
-
How i can sent URL by the server? Only elements. Check me, please. Send link to client. --Server function link() link = "http://radiorecord.fm/m3u/trap320-32kbps.m3u" triggerClientEvent( 'linkplaySound', link ) end addEvent('urlDim', true) addEventHandler( 'urlDim', root, link ) Take link from client. --Client function playSound() sound3DSound = playSound3D ( ''..link..'', 0,0,0, true ) end addEvent('linkplaySound', true) addEventHandler( 'linkplaySound', root, playSound ) function onClickPlay(button) ... local dimensionPlayer = getElementDimension ( getLocalPlayer ( ) ) if ( guiGetText( Radio.combobox[1] ) == 'Dubstep #1' ) then sound3DSound = "http://radiorecord.fm/m3u/trap320-32kbps.m3u" triggerServerEvent( 'urlDim', sound3DSound, dimensionPlayer ) -- when i start play sound, then link and dimension send to server.(Server need only link. I feel a lot of mistakes.) setElementDimension( sound3DSound, dimensionPlayer ) ... end end attachElements( sound3DSound, getLocalPlayer ( ) ) end end end
-
Yes, I read the forum. Here, everything is more difficult for me. I do not know where to use the trigger on the client from the server. Nothing happens. Turned out only without using GUI. If you need the full code, I strip off in HP. I need to solve this problem. I still have 3 of my script that you want to finish. (
-
And it's not ingame? Do it with editor.
-
local coordM = { {1320.80005, 1254.69995, 14.6}, {2504.6001, 1144, 18.7}, {2315, 1761.09998, 11.3}, {2659, 1942.19995, 10.9}, {2040.40002, 2143.3999, 20.8}, {2489.09961, 2394.69922, 4.4}, {-2478.5, 1550.30005, 33.2}, {1193.5, 2772.2998, 10.6}, {-590.39941, 3038.69922, -1.8}, {-1851.2998, 1287.09961, 41.3}, {-2185.30005, 2415.6001, 4.7}, {-2837.2998, 2715.2998, 238.8}, {-661.90002, 2306.3999, 135.89999}, {354.60001, 2432.6001, 18.1}, {2300.30005, 1902.09998, 26.3}, {2000.2998, 1592.39941, 17.6}, {1951.69995, -231.2, -10.3}, {1698.80005, -342.5, 38.4}, {89.3, -302, 1.8}, {2205, -2431.6001, 20.1}, {1045.59961, -311.7998, 77.2}, {2170.39941, -1518.89941, 24.6}, {1921.19995, -2568.8999, 13.5}, {820.70001, -2048.6001, 12.7}, {-319.20001, -1854, -9.4}, {-1198.80005, -1170, 129.39999}, {-996.2998, -1014.89941, 94.6}, {-1198.7998, -1170, 129.39999}, {-1465, -2497.3999, 55}, {2409.30005, -1208, 28.8}, {2637.19995, -1471.30005, 16.5} } for i=1, #coordM do createPickup ( coordM[1], coordM[2], coordM[3], 3, 1274, 172800000 ) end Create table, with array create pickups. I do not know, working or not. But everything about the case. sorry 4 eng me too. Dont speaking on this lang.
-
Another question, if I may. Music does not play for everyone. Need trigger server-client. How can I implement it in the code? Hard to imagine a sequence. function onClickPlay(button) for _, n in ipairs (radSpis) do if button == "left" then if ( guiGetText( Radio.combobox[1] ) ~= tostring('Click to open') ) and ( guiGetText( Radio.edit[1] ) ~= "" ) then outputChatBox( 'Choose one thing!' ) return end stopSound(sound3DSound) if ( guiGetText( Radio.edit[1] ) ~= "" ) and ( guiGetText( Radio.combobox[1] ) == tostring('Click to open') ) then sound3DSound = playSound3D ( guiGetText( Radio.edit[1] ), x,y,z, true ) break else local dimensionPlayer = getElementDimension ( getLocalPlayer ( ) ) if ( guiGetText( Radio.combobox[1] ) == 'Dubstep #1' ) then sound3DSound = playSound3D ( "http://radiorecord.fm/m3u/trap320-32kbps.m3u", x,y,z, true ) setElementDimension( sound3DSound, dimensionPlayer ) elseif ( guiGetText( Radio.combobox[1] ) == 'Club Society' ) then sound3DSound = playSound3D ( "http://radio.freshclub.net:9000/8094", x,y,z, true ) setElementDimension( sound3DSound, dimensionPlayer ) elseif ( guiGetText( Radio.combobox[1] ) == 'Trap' ) then sound3DSound = playSound3D ( "http://www.radiorecord.fm/m3u/trap320-32kbps.m3u", x,y,z, true ) setElementDimension( sound3DSound, dimensionPlayer ) elseif ( guiGetText( Radio.combobox[1] ) == 'Mfm' ) then sound3DSound = playSound3D ( "http://radio.mfm.ua/online128.m3u", x,y,z, true ) setElementDimension( sound3DSound, dimensionPlayer ) elseif ( guiGetText( Radio.combobox[1] ) == 'Click to open' ) then return end end attachElements( sound3DSound, getLocalPlayer ( ) ) end end end
-
Can you give me an example of an argument passed? In the wiki there is no such example, here and do what comes to mind.
-
I get false triggerClientEvent(source, 'Hello', root, source ) -- pass source to client addEventHandler( "Hello", getRootElement(), HelloEnable ) -- Open GUI -- next i send a request 'Helper' function sentBox() triggerServerEvent( 'sentBoxHelper', root, thePlayer ) disable() end function sentBox(thePlayer) local players = getElementsByType ( "player" ) -- get a table of all the players in the server for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Helper" ) ) ) then triggerClientEvent(thePlayer, 'sentBoxHelperBar', root, thePlayer) end end end -- i filter players and open new GUI helphim.window[1] = guiCreateWindow(gx/2-310, gy/2-140, 532, 103, 'This player' ..tostring(source).. ' - need help!!!', false) -- 'source' -> 'false'
-
Hi, sorry for the use of an interpreter. Q: How can I transfer the user information between server-client? Example: function prov(thePlayer) triggerClientEvent(thePlayer, 'Hello', getRootElement ( ), thePlayer ) end addCommandHandler('pr', prov) function HelloEnable(source) guiSetVisible(hello.window[1],true) guiSetInputEnabled(true) showCursor(true) end addEvent( "Hello", true ) addEventHandler( "Hello", getRootElement(), HelloEnable ) ... -- Opens GUI - user agreed - opens another GUI user group 'Helper' - a user group 'Helper' agrees - it will teleport to the first player who agreed in the first GUI. function sentBoxHelperBar(thePlayer) guiSetVisible(helphim.window[1],true) guiSetInputEnabled(true) showCursor(true) end addEvent( "sentBoxHelperBar", true ) addEventHandler( "sentBoxHelperBar", getRootElement(), sentBoxHelperBar ) helphim = { button = {}, window = {} } helphim.window[1] = guiCreateWindow(gx/2-310, gy/2-140, 532, 103, 'This player ' ..tostring(getElementData( thePlayer, 'nickNamePom' )).. ' - need help!!!', false) guiWindowSetSizable(helphim.window[1], false) guiSetVisible(helphim.window[1],false) guiSetInputEnabled(false) showCursor(false) helphim.button[1] = guiCreateButton(45, 34, 188, 45, "Ok", false, helphim.window[1]) guiSetProperty(helphim.button[1], "NormalTextColour", "FFAAAAAA") helphim.button[2] = guiCreateButton(296, 34, 188, 45, "Later", false, helphim.window[1]) guiSetProperty(helphim.button[2], "NormalTextColour", "FFAAAAAA")
-
На Client: function check(timer) hours, minutes = getTime() timePrison = timer+minutes if (tonumber(timePrison)>60) then hours=hours+1 timePrison=minutes-timePrison end local prisTimer = setTimer(function() hoursN, timeN = getTime() if ( hoursN == hours and timeN == timePrison) then if isTimer ( prisTimer ) then killTimer ( prisTimer ) end end end, 1000, 0) end addEvent( "checkTimer", true ) addEventHandler( "checkTimer", getRootElement(), check )
-
Писал, писал, решил дописать код. Используя таблицы, вносил игроков и таймер в ячейки, чтобы потом по ним проходиться и пользоваться. Из-за моего малого опыта наделал ошибки. Первого игрока освобождает заранее, второй остается за решеткой с 2-ой ошибкой. 1) Массив в строке (29-34) повторяется 2 раза. 2) Ошибки. Видимо, неверно составил алгоритм работы. (71 строка) idtableonline = {} function idtableonlineresourceStart () for i = 1, 10 do idtableonline[i] = false end end addEventHandler("onResourceStart", root, idtableonlineresourceStart) function sitPr ( thePlayer, cmd, Psource, timer ) for _, aclGr in ipairs ( { 'Security', 'FBI' } ) do if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( aclGr ) ) == true ) then if ( isElementWithinColShape ( thePlayer, fP ) ) then if ( Psource ) then local occup = getPedOccupiedVehicle ( thePlayer ) if ( occup ) then local Psource = getPlayerFromName ( Psource ) local occupData = setElementData ( Psource, "namePrison", tostring(getPlayerName ( Psource )) ) if ( isElementWithinColShape ( Psource, fP ) ) then if ( pC[ getElementModel( getPedOccupiedVehicle ( thePlayer ) ) ] ) then local rnd = math.random ( 1, #habz ) if ( getVehicleOccupant ( occup ) ) then if (tonumber(timer) <= 30) then local account = getPlayerAccount ( Psource ) local oldskin = setAccountData ( account, 'oldskin', tostring (getElementModel ( Psource )) ) local oldfgt = setAccountData ( account, 'oldfgt', tostring (getPedFightingStyle ( Psource )) ) takePlayerMoney ( Psource, 15000 ) givePlayerMoney ( thePlayer, 15000 ) outputChatBox ( 'Не забудьте, что без Вас из тюрьмы никто не выберется!', thePlayer, 255, 145, 0 ) outputChatBox ( 'Следить за временем заключения - Ваша работа!', thePlayer, 255, 145, 0 ) setPlayerMuted ( Psource, true ) outputChatBox ( 'Вы были обезмолвлены на время заключения.', Psource, 255, 145, 0 ) outputChatBox ( 'Если кто-то из работников полиции нарушит свои полномочия - обращайтесь в', Psource, 255, 145, 0 ) outputChatBox ( '/report, либо в группу. За Вами обязательство предъявить надлежащие факты.', Psource, 255, 145, 0 ) setTimer (fadeCamera, 2000, 1, Psource, true) setTimer (function() spawnPlayer ( Psource, habz[rnd][1], habz[rnd][2], 1004, 90, 299, 3, 0 ) setCameraTarget ( Psource ) end, 2000, 1 ) for i=1, 10 do if prisoner[i]==nil then outputChatBox('1') prisoner['iname']=getPlayerName( Psource ) prisoner['itimer']=tonumber(timer) break else return end end for i=1, 10 do if (idtableonline[i] == false) then if tonumber(prisoner['itimer'])~=nil then if prisoner['itimer'] and prisoner['iname'] then idtableonline[i] = true break end end end i=i end setTimer(function() for i=1, 10 do if (idtableonline[i] == true) then if tonumber(prisoner['itimer'])~=nil then if prisoner['itimer'] and prisoner['iname'] then prisoner['itimer']=tonumber(prisoner['itimer'])-1 outputChatBox('first:'..prisoner['itimer']..'') end end end if (tonumber(prisoner['itimer']) <= 0 ) then outputChatBox('second:'..prisoner['itimer']..'') spawnPlayer(getPlayerFromName(tostring(prisoner['iname'])),0,0,0) prisoner['itimer']=nil prisoner['iname']=nil idtableonline[i] = false end end end, 60000, 0) else outputChatBox('Нельзя сажать дольше, чем на 30 минут.', thePlayer, 255, 0, 0 ) end end end end end end end end end end addCommandHandler ( 'sPr', sitPr )
-
Как я могу передать 'thePlayer' из функции внутрь setTimer? setTimer(function(source) local x,y,z = getElementPosition(source) setElementData(root, 'positionUsx', x) setElementData(root, 'positionUsy', y) setElementData(root, 'positionUsz', z) triggerClientEvent(source, 'Hello', root, source ) end, 10000, 1)
-
Не открывается список. radSpis = { {"http://radiorecord.fm/m3u/trap320-32kbps.m3u", "Dubstep #1"}, {"http://radiorecord.fm/m3u/trap320-32kbps.m3u", "Hard Rock #1"} } Radio.combobox[1] = guiCreateComboBox(20, 146, 307, 21, "Список радио:", false, Radio.window[1]) for s, n in ipairs (radSpis) do local url, name = unpack ( n ) guiComboBoxAddItem(Radio.combobox[1], tostring ( name )) end
-
Русские доки / мануалы / туториалы по Lua и MTASA
nikitafloy replied to MX_Master's topic in Скриптинг
http://www.cronos.ru/kb-cronospro-lua.html -- Отлично расписано! -
Use translate (i feeling problem with translation): Hello I have not received a response to Russian topic , it is necessary to contact you . In this piece of script prisoner sits in jail . The problem is that he is not released. The aim - to record every prisoner in the table with a timer and release on the table. Debag not display errors . But after the change in teams players now do not spawn at the expiration of the timer. Yes, perhaps , is the logic ' curve ' . I 'm trying to write something a little more serious. Otherwise have to put all the prisoners , one in the chamber and release of kolsheypa as well . Will be glad to answer any . local prisoners = {} -- create a table function sitPr (thePlayer, cmd, Psource, toTime) for _, aclGr in ipairs ({'Security', 'FBI'}) do if (isObjectInACLGroup ("user." .. getAccountName (getPlayerAccount (thePlayer)), aclGetGroup (aclGr)) == true) then if (isElementWithinColShape (thePlayer, fP)) then local occup = getPedOccupiedVehicle (thePlayer) if (occup) then if (toTime) then local toTime = tonumber (toTime) local Psource = getPlayerFromName (Psource) if (pC [getElementModel (getPedOccupiedVehicle (thePlayer))]) then if (toTime < 30 ) then local rnd = math.random ( 1 , # habz) if (getVehicleOccupant (occup, 2 )) then local account = getPlayerAccount (Psource) local oldskin = setAccountData (account, 'oldskin', tostring (getElementModel (Psource))) local oldfgt = setAccountData (account, 'oldfgt', tostring (getPedFightingStyle (Psource))) takePlayerMoney (Psource, 15000) givePlayerMoney (thePlayer, 15000) setTimer (fadeCamera, 2000 , 1 , Psource, true) setTimer (function () spawnPlayer (Psource, habz [rnd] [ 1 ], habz [rnd] [ 2] , 1004, 90 , 299 , 3, 0 ) setCameraTarget (Psource) end, 2000 , 1) prisoners [# prisoners +1] = {toTime, Psource} -- gets the length of the table and add a new element in the form of { time } player's name . setTimer (function () for _, i in pairs (prisoners) do -- get a table of the same species . Psource = i [ 2] -- ' say' that the name of the player is the data of all tables at No. 2. toTimeTo = i [ 1] -- ' say' that the time before the player is the data of all tables at number 1. if toTimeTo == toTime then -- if the time is output through time toTime, when the timer expires, designated in advance to land rights. In other words, if the time limit expires , the ... elseif toTimeTo then -- Or , if you suddenly turned out that the time of the player < time appointed for advance team landed Psource, then we will produce it . (5 < 30) ( Here is my logic turns off, because this should not be ) local account = getPlayerAccount (Psource) local lodskin = getAccountData (account, 'oldskin') local ofgt = getAccountData (account, 'oldfgt') setPedFightingStyle (Psource, tostring (ofgt)) setCameraTarget (Psource) spawnPlayer (Psource, 2290.19995, 2430.5, 10.8, 180 , tostring (lodskin), 0, 0) prisoners [Psource] = nil -- table.remove () - replacement , but how is it used ? elseif toTimeTo> toTime then -- or , if the time before the release of more than the time specified for another prisoner , then we obtain from the first timer if isTimer (toTimeTo) then -- if it exists, toTime = toTimeTo -- set the time for it setTimer (function () local account = getPlayerAccount (Psource) local lodskin = getAccountData (account, 'oldskin') local ofgt = getAccountData (account, 'oldfgt') setPedFightingStyle (Psource, tostring (ofgt)) setCameraTarget (Psource) spawnPlayer (Psource, 2290.19995, 2430.5, 10.8, 180 , tostring (lodskin), 0, 0) prisoners [Psource] = nil -- table.remove () end, toTime * 60000 , 1) -- Now, after a while he gets out else outputChatBox ('No1.') end else outputChatBox ('No2.') end end end, toTime * 60000 , 1) elseif (getVehicleOccupant (occup, 3 )) then ... end end end end end end end end end addCommandHandler ('sPr', sitPr)
-
I find this files and reinstall folder 'audio', but problem remained. http://pastebin.mtasa.com/349872591
-
Получаем колшейп пикапа: local pShape = getElementColShape ( pPickup ) Привязываем эвент для колшейпа: addEventHandler ( "onColShapeHit", pShape, TakeMoney ) Делаем саму функцию: function TakeMoney ( pHitElement, bMatchingDimension ) if bMatchingDimension and getElementType ( pHitElement ) == "vehicle" then local iNumber = 1000 local pPlayer = getPedOccupiedVehicle ( pHitElement ) givePlayerMoney ( pPlayer, iNumber ) end end Спасибо, уже давнено эту проблему решил, про тему забыл.
-
Буду очень признателен и благодарен. local CPc = cols[CP] local Благодарю. Но теперь, либо я не могу понять логику и делаю не так, либо я точно делаю не так, может и поможете, кто поопытнее меня. Дэбаг молчит. local prisoners = {} -- Создаю таблицу function sitPr ( thePlayer, cmd, Psource, toTime ) for _, aclGr in ipairs ( { 'Security', 'FBI' } ) do if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( aclGr ) ) == true ) then if ( isElementWithinColShape ( thePlayer, fP ) ) then local occup = getPedOccupiedVehicle ( thePlayer ) if ( occup ) then if ( toTime ) then local toTime = tonumber(toTime) local Psource = getPlayerFromName ( Psource ) if ( pC[ getElementModel( getPedOccupiedVehicle ( thePlayer ) ) ] ) then if ( toTime < 30 ) then local rnd = math.random ( 1, #habz ) if ( getVehicleOccupant ( occup, 2 ) ) then local account = getPlayerAccount ( Psource ) local oldskin = setAccountData ( account, 'oldskin', tostring (getElementModel ( Psource )) ) local oldfgt = setAccountData ( account, 'oldfgt', tostring (getPedFightingStyle ( Psource )) ) takePlayerMoney ( Psource, 15000 ) givePlayerMoney ( thePlayer, 15000 ) setTimer (fadeCamera, 2000, 1, Psource, true) setTimer (function() spawnPlayer ( Psource, habz[rnd][1], habz[rnd][2], 1004, 90, 299, 3, 0 ) setCameraTarget ( Psource ) end, 2000, 1 ) prisoners[#prisoners+1] = {toTime, Psource} -- Получаю длину таблицы и добавляю новый элемент в виде {Время, имя игрока}. setTimer ( function() for _, i in pairs (prisoners) do -- получаю таблицу того же вида. Psource = i[2] -- 'говорю', что имя игрока это данные всех таблиц под номером 2. toTimeTo = i[1] -- 'говорю', что время до выхода игрока это данные всех таблиц под номером 1. if toTimeTo == toTime then -- если время равно времени выхода через toTime, когда таймер истекает, назначенный заранее, чтобы посадить человека. Иными словами, если срок истекает, то... elseif toTimeTo < toTime then -- Или, если вдруг получилось, что время выхода игрока < времени назначенного заранее командой для посаженного Psource, тогда мы его выпускаем. (5 < 30) (Здесь логика моя отключилась, ибо такого быть не должно) local account = getPlayerAccount ( Psource ) local lodskin = getAccountData ( account, 'oldskin' ) local ofgt = getAccountData ( account, 'oldfgt' ) setPedFightingStyle ( Psource, tostring (ofgt) ) setCameraTarget ( Psource ) spawnPlayer ( Psource, 2290.19995, 2430.5, 10.8, 180, tostring (lodskin), 0, 0 ) prisoners[Psource] = nil -- table.remove ( ) - замена, но как она используется? elseif toTimeTo > toTime then -- или, если время до выхода больше, чем время, указанное для другого заключенного, тогда получаем таймер у первого if isTimer(toTimeTo) then -- если он существует, то toTime = toTimeTo -- ставим время для него setTimer (function() local account = getPlayerAccount ( Psource ) local lodskin = getAccountData ( account, 'oldskin' ) local ofgt = getAccountData ( account, 'oldfgt' ) setPedFightingStyle ( Psource, tostring (ofgt) ) setCameraTarget ( Psource ) spawnPlayer ( Psource, 2290.19995, 2430.5, 10.8, 180, tostring (lodskin), 0, 0 ) prisoners[Psource] = nil -- table.remove ( ) end, toTime*60000, 1 ) -- Теперь через некоторое время его выпустят else outputChatBox ( 'No1.' ) end else outputChatBox ( 'No2.' ) end end end, toTime*60000, 1) elseif ( getVehicleOccupant ( occup, 3 ) ) then ... end end end end end end end end end addCommandHandler ( 'sPr', sitPr ) Что будет в сл. циклах я боюсь представить.
-
missing GTA files: audio/streams/... Reinstalled, MTADiag prints too. This may not be because of assembly GTA SA because half year all was well.
-
local CPc = cols[CP] local Благодарю. Но теперь, либо я не могу понять логику и делаю не так, либо я точно делаю не так, может и поможете, кто поопытнее меня. Дэбаг молчит. local prisoners = {} -- Создаю таблицу function sitPr ( thePlayer, cmd, Psource, toTime ) for _, aclGr in ipairs ( { 'Security', 'FBI' } ) do if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( aclGr ) ) == true ) then if ( isElementWithinColShape ( thePlayer, fP ) ) then local occup = getPedOccupiedVehicle ( thePlayer ) if ( occup ) then if ( toTime ) then local toTime = tonumber(toTime) local Psource = getPlayerFromName ( Psource ) if ( pC[ getElementModel( getPedOccupiedVehicle ( thePlayer ) ) ] ) then if ( toTime < 30 ) then local rnd = math.random ( 1, #habz ) if ( getVehicleOccupant ( occup, 2 ) ) then local account = getPlayerAccount ( Psource ) local oldskin = setAccountData ( account, 'oldskin', tostring (getElementModel ( Psource )) ) local oldfgt = setAccountData ( account, 'oldfgt', tostring (getPedFightingStyle ( Psource )) ) takePlayerMoney ( Psource, 15000 ) givePlayerMoney ( thePlayer, 15000 ) setTimer (fadeCamera, 2000, 1, Psource, true) setTimer (function() spawnPlayer ( Psource, habz[rnd][1], habz[rnd][2], 1004, 90, 299, 3, 0 ) setCameraTarget ( Psource ) end, 2000, 1 ) prisoners[#prisoners+1] = {toTime, Psource} -- Получаю длину таблицы и добавляю новый элемент в виде {Время, имя игрока}. setTimer ( function() for _, i in pairs (prisoners) do -- получаю таблицу того же вида. Psource = i[2] -- 'говорю', что имя игрока это данные всех таблиц под номером 2. toTimeTo = i[1] -- 'говорю', что время до выхода игрока это данные всех таблиц под номером 1. if toTimeTo == toTime then -- если время равно времени выхода через toTime, когда таймер истекает, назначенный заранее, чтобы посадить человека. Иными словами, если срок истекает, то... elseif toTimeTo < toTime then -- Или, если вдруг получилось, что время выхода игрока < времени назначенного заранее командой для посаженного Psource, тогда мы его выпускаем. (5 < 30) (Здесь логика моя отключилась, ибо такого быть не должно) local account = getPlayerAccount ( Psource ) local lodskin = getAccountData ( account, 'oldskin' ) local ofgt = getAccountData ( account, 'oldfgt' ) setPedFightingStyle ( Psource, tostring (ofgt) ) setCameraTarget ( Psource ) spawnPlayer ( Psource, 2290.19995, 2430.5, 10.8, 180, tostring (lodskin), 0, 0 ) prisoners[Psource] = nil -- table.remove ( ) - замена, но как она используется? elseif toTimeTo > toTime then -- или, если время до выхода больше, чем время, указанное для другого заключенного, тогда получаем таймер у первого if isTimer(toTimeTo) then -- если он существует, то toTime = toTimeTo -- ставим время для него setTimer (function() local account = getPlayerAccount ( Psource ) local lodskin = getAccountData ( account, 'oldskin' ) local ofgt = getAccountData ( account, 'oldfgt' ) setPedFightingStyle ( Psource, tostring (ofgt) ) setCameraTarget ( Psource ) spawnPlayer ( Psource, 2290.19995, 2430.5, 10.8, 180, tostring (lodskin), 0, 0 ) prisoners[Psource] = nil -- table.remove ( ) end, toTime*60000, 1 ) -- Теперь через некоторое время его выпустят else outputChatBox ( 'No1.' ) end else outputChatBox ( 'No2.' ) end end end, toTime*60000, 1) elseif ( getVehicleOccupant ( occup, 3 ) ) then ... end end end end end end end end end addCommandHandler ( 'sPr', sitPr ) Что будет в сл. циклах я боюсь представить.
-
After a couple of seconds respawn. Texture disappear. http://speedy.sh/dBze4/public.rar
-
Применяю для извлечения колшейпов: local cols = {} function freezP( attacker, weapon, bodypart, loss ) ... local x, y, z = getElementPosition ( source ) CP = createColSphere(x, y, z, 4) cols[CP] = CPc ... end addEventHandler ( "onPlayerDamage", root, freezP ) function inCar ( thePlayer, cmd, Psource ) ... local CPc = cols[CP] if ( isElementWithinColShape ( thePlayer, CPc ) ) then ... end end addCommandHandler ( 'tPr', inCar ) debug: attempt to concatenate 'CPc' ( nil value )