-
Posts
419 -
Joined
-
Last visited
-
Days Won
1
Everything posted by nikitafloy
-
showPlayerHudComponent Пробовал. Ничего не даёт. А вот радар как показывал, так и показывает, всё остальное пропадает. Может, проблема в коде? Я использовал, все работало. Создавал зону, где вырубаются датчики и радары с картой. Все работало безупречно. После выхода с зоны все включалось.
-
showPlayerHudComponent
-
Do not use after the change to source (marker). The script did not work right when I start the server and teleported with editor. Now until everything works, I'm working on the script. Try to restart the server and include the resource again later.
-
Dont work again: Current part of code: function createMaks() for i, o in ipairs (markReady) do mReady = createMarker ( o[1],o[2], 1043.3, "cylinder", 2, 255,0,0, 100 ) addEventHandler( "onMarkerHit", mReady, stayRead ) setElementInterior( mReady, 2 ) end addEventHandler( "onResourceStart", resourceRoot, createMaks ) function stayRead( hitElement ) outputDebugString('0') local attachE = getAttachedElements ( hitElement ) if attachE then for _, k in ipairs (attachE) do if getElementType (k) == 'Object' then if getElementModel (k) == 3016 then destroyElement ( factoryDo ) for i=1, #markReady do if isElementWithinMarker ( hitElement, source ) then local x,y,z = getElementPosition( source ) createObject( 3016, x,y-1,z+1 ) end end end end end for i=1, #GTAupr do toggleControl ( hitElement, GTAupr[i], true ) end end end
-
You can specify the element ID, an event when a player comes out of the car and remove the visibility for the player.
-
Increased and lifted. Stop......I'm shocked. Why did it work now? After all, I considered such a stupid mistake. So much time lost. Thank you for your patience.
-
Oh, yes. I can use source. Because event for marker with the interior > 0 does not work. And I must to restart permanently Editor, I do not know how it is related, but, thanks to this, the marker is determined 0th interior. ------ Dont work. for i, o in ipairs (markers) do mDo = createMarker ( o[1],-1290.8, 1043.2, "cylinder", 0.3, 28, 239, 0, 160 ) addEventHandler( "onMarkerHit", mDo, facJob ) setElementInterior( mDo, 2 ) end function facJob( hitElement, matchingDimension ) -- изготовление деталей outputDebugString('1') -- dont write to debug. for i=1, #markers do ... end end --------------- You can see what's wrong. 1) I rise on a marker and nothing happens. 2) Start editor. 3) Stop editor and restart script. 4) I teleported to a place in front of me there was a box. Thereafter, neither the marker is no longer working. All have to repeat with the second point. Sorry for translate. http://video.yandex.ru/iframe/nikita505 ... gskv.1631/
-
http://pastebin.com/0nEiLp0y
-
Use for identification. function facJob( hitElement, matchingDimension ) outputDebugString('1') for i=1, #markers do if isElementWithinMarker ( hitElement, getElementByID( 'do_' .. i ) ) then local x,y,z = getElementPosition(getElementByID( 'do_' .. i )) setElementVisibleTo ( getElementByID( 'doMarker_' .. i ), root, false ) setTimer ( setElementVisibleTo, 26000, 1, getElementByID( 'do_' .. i ), root, true ) spawnPlayer ( hitElement, x,y-0.3,z, 180, getElementModel( hitElement ), 2, 0 ) setCameraTarget ( hitElement ) factoryDo = createObject( 3016, x,y-1,z+1 ) setElementInterior( factoryDo, 2 ) triggerClientEvent( 'getBone', hitElement, client ) end end end
-
Ковыряй код heditor'а. Найдешь там эту функцию, задашь ей бинд через BindKey. Надпись через: dxDrawText dxGetFontHeight dxGetTextWidth dxCreateFont Вот так получится (Пример): addEventHandler("onClientRender", root, function() dxDrawText("Sport", 17, 171, 332, 226, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Sport", 16, 170, 331, 225, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) end )
-
Does not work. I create two markers, the one who, without interior - have triggered the handler. But that's not all. Marker works only through a special procedure: On Editor, move to interior, Editor disable, restart the script. When it works, then stop working on other handlers markers.
-
Here's the error: When I change the interior marker event does not fire. What should I do? Use colshape, or to create a marker? Or you can fix this problem in another way?
-
'NEWTOPIC'
-
Done differently debag writes nothing but event does not fire. function createFunc() for i, o in ipairs (markers) do markerDo = createMarker ( o[1],-1290.8, 1043.2, "cylinder", 1, 28, 239, 0, 160 ) setElementID ( markerDo, 'do_' .. i ) setElementInterior( markerDo, 2 ) end addEventHandler( 'onMarkerHit', markerDo, jobFactory ) end addEventHandler( "onResourceStart", getRootElement(), createFunc ) function jobFactory( hitElement, matchingDimension ) for i=1, #markers do if isElementWithinMarker ( hitElement, getElementByID( 'do_' .. i ) ) then outputChatBox('Да') end end end
-
Why I can not identify a marker for ID? (For colshape it worked fine.) function createFunc() for i, o in ipairs (markers) do marker = createMarker ( o[1],-1290.8, 1043.2, "cylinder", 0.3, 28, 239, 0, 160 ) setElementID ( marker, 'do_' .. i ) setElementInterior( marker, 2 ) end end addEventHandler( "onResourceStart", resourceRoot, createFunc ) function jobFactory( hitElement, matchingDimension ) for i=1, #markers do if isElementWithinMarker ( hitElement, getElementByID( 'do_' .. i ) ) then outputChatBox('Да') end end end addEventHandler( 'onMarkerHit', resourceRoot, jobFactory )
-
But this code works, but he is not.
-
then, why does it work? server: function takeMoneyDet( thePlayer, money ) local accPlayer = getPlayerAccount( thePlayer ) local money = getTickCount() + money/210*60*1000 setAccountData ( accPlayer, "detector-have", money ) timerDetect = tonumber(getAccountData ( accPlayer, "detector-have" )) triggerClientEvent( thePlayer, 'rasschet', thePlayer, client, timerDetect ) end addEvent( 'takeMoneyDet', true ) addEventHandler( 'takeMoneyDet', getRootElement(), takeMoneyDet ) client: function rasschet( player, timerDetect ) timerCheck = setTimer(function() timerDetect = timerDetect-getTickCount() triggerServerEvent( 'update30', localPlayer, timerDetect ) if timerDetect <= 0 then triggerServerEvent( 'unableDetect', localPlayer ) killTimer( timerCheck ) end end, 30000, 0 ) end
-
getTickCount () show the work of the server itself, no? 'This function returns amount of time that your system has been running in milliseconds. '
-
why its dont work? Which equation correctly for Timer? server: function sitPr ( thePlayer, cmd, timer, Psource ) local timer = getTickCount() + timer*60*1000 triggerClientEvent ( Psource, 'checkTimer', Psource, Psource, timer ) addCommandHandler ( 'sPr', sitPr ) Client: function check(Psource, timer) timerCheck = setTimer(function() outputChatBox('1 '..tonumber(timer)) outputChatBox('2 '..tonumber(current)) outputChatBox('3 '..tonumber(rezoneTimer)) if timer <= getTickCount() then triggerServerEvent( 'Vipustit', getLocalPlayer(), localPlayer ) killTimer( timerCheck ) end end, 1000, 0 ) end addEvent( 'checkTimer', true ) addEventHandler( 'checkTimer', getRootElement(), check )
-
thx u guys. 1st post is all true.
-
How can I send a message after you specify 'id'? If I enter a variable, it takes the value to any sign within. Example n 0 Hi, I know what you did last summer! Output: , Hi function writetoID( player, command, id, text ) local plName = getElementByID ( 'ID' .. tostring(id) ) if plName == nil then outputChatBox ("Нет игрока под этим ID.", player ) else local myName = tostring(getPlayerName(plName)) local r,g,b = getPlayerNametagColor(plName) local rn = string.format("#%02X%02X%02X", r,g,b) source = player local text = tostring(text) sendMSG( rn..''..myName..'#ffffff, ' ..text, 0 ) end end addCommandHandler( 'n', writetoID )
-
Thanks, I used what you wrote in the first post. How i can ban cmd for frozen user? addEventHandler("onPlayerCommand", resourceRoot, function(cmd) local accPlayer = getAccountPlayer ( source ) if tonumber(getAccountData ( accPlayer, "jail-time" )) > 0 or isElementFrozen( source ) then cancelEvent() end end) Freeze with: setElementFrozen ( source, true )
