Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Kenix

    xml

    myyusuf, Learn lua again if you not understand. viewtopic.php?f=148&t=40809 local nVar -- nil print( nVar ) -- nil print( nVar + 1 ) -- attempt to perform arithmetic on local 'nVar' (a nil value) print( nNotDefined ) -- nil print( nNotDefined + 1 ) -- attempt to perform arithmetic on global 'nNotDefined' (a nil value) So you need define variable.
  2. omg ... I did give you links for learning, but you not want learn. Ok
  3. You need learn again! What is it?!! And it
  4. ElMota, ... Can you learn? I said you more times learn it, but you not want .. https://wiki.multitheftauto.com/wiki/AddEventHandler viewtopic.php?f=148&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
  5. Kenix

    Some help

    window = guiCreateWindow(325,111,482,473,"SHG User Panel",false) guiWindowSetSizable(window,false) grid1 = guiCreateGridList(242,30,228,347,false,window) guiGridListSetSelectionMode(grid1,2) guiGridListAddColumn(grid1,"Player Name",0.2) guiGridListAddColumn(grid1,"Wanted",0.2) guiSetAlpha(grid1,0.69999998807907) pinunpinplayer = guiCreateButton(250,392,215,69,"Pin / Unpin Player",false,window) EDchat = guiCreateButton(22,33,210,69,"Enable / Disable Chat",false,window) becomecivilanB = guiCreateButton(24,270,210,69,"Become civilan",false,window) suicideB = guiCreateButton(25,192,210,69,"Suicide",false,window) EDhud = guiCreateButton(23,112,210,69,"Enable / Disable Hud",false,window) shglabel = guiCreateLabel(57,372,138,61,"SHG",false,window) guiSetFont(shglabel,"sa-gothic") guiSetVisible( window, false ) function menuShow () guiSetVisible( window, not guiGetVisible( window ) ) showCursor( not isCursorShowing( ) ) end bindKey ("F4", "down", menuShow )
  6. Kenix

    Some help

    lol? Your attach element ( thePlayer ) here is nil. https://wiki.multitheftauto.com/wiki/AddEventHandler
  7. 123456zuk, Вручную проверяй возвращаемое значение функции. С помощью функций outputChatBox outputDebugString, ... Тогда уже сам поймёшь где ошибся. Ясное дело если функция ( например engineLoadCOL ) возвразает false, то уже будет понятно, то что ты неверное сделал ( неверные аргументы или ещё что ). Ну, а если юзердату, то волноваться не зачем.
  8. Kenix

    script prob

    No It's incorrect Because arguments is bool outputChatBox ( string text [, int r=255, int g=255, int b=255, bool colorCoded=false ] )
  9. local tNormalyHorn = { } local uDetachTimer = { } function hornPlayForthePlayer( uPlayer, sPlayerHorns, nAlreadySet ) if nAlreadySet ~= 0 then if not tNormalyHorn[ uPlayer ] then tNormalyHorn[ uPlayer ] = { } end tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] + 1 ] = playSound3D( sPlayerHorns, getElementPosition( uPlayer ) ) setSoundMaxDistance( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ],75 ) setSoundVolume( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ],0.95 ) attachElements( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ], uPlayer, 0, 0, 0.5 ) local nLengthOfFile = getSoundLength( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ] ) if isTimer( uDetachTimer[ uPlayer ] ) then killTimer( uDetachTimer[ uPlayer ] ) uDetachTimer[ uPlayer ] = nil end uDetachTimer[ uPlayer ] = setTimer( function( tNormalyHorn, uPlayer ) if isElementAttached( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ] ) then detachElements( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ] ) stopSound( tNormalyHorn[ uPlayer ][ #tNormalyHorn[ uPlayer ] ] ) end end, nLengthOfFile * 1000 - 100, 1, tNormalyHorn, uPlayer ) end end м?
  10. Kenix

    script prob

    addEventHandler ( 'onClientPlayerDamage', localPlayer, function( _, nWeapon ) if nWeapon == 4 then cancelEvent( ) end end )
  11. Kenix

    stack overflow

    What you not understand?
  12. Kenix

    Need Help

    source used in events ( client side and server side ). client used only in server side events and https://wiki.multitheftauto.com/wiki/AddEventHandler https://wiki.multitheftauto.com/wiki/Event_system https://wiki.multitheftauto.com/wiki/Client
  13. Kenix

    Need Help

    Predefined variable client only in server side! viewtopic.php?f=91&t=39678
  14. Kenix

    stack overflow

    It's example function fStackOverflow( ) fStackOverflow( ) end local name, author, lastTimePlayed, playedCount, modename local startTick local month = {"January","February","March","April","May","June","Juli","August","September","October","November","December"} local screenWidth, screenHeight = guiGetScreenSize() local endPosition = screenHeight-140 local moveback = false function timestampToDate(stamp) local time = getRealTime(stamp) return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour,time.minute) end function handleMapInfo(mapInfo) name = mapInfo.name or "Unknown" author = mapInfo.author or "Unknown" lastTimePlayed = timestampToDate(mapInfo.lastTimePlayed) or "Unknown" playedCount = tostring(mapInfo.playedCount or "Unknown") modename = mapInfo.modename ~= "Destruction derby" and mapInfo.modename or "Destruction derby" position = screenHeight+90 movePosition = 5 tickCount = 400 moveback = false alpha = 0 addEventHandler("onClientRender",getRootElement(),drawMapInfo) end addEvent("onClientMapStarting",true) addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) function drawMapInfo () if position == endPosition then if tickCount == 0 then moveback = true end tickCount = tickCount-1 movePosition = 0 end if position >= screenHeight+91 then removeEventHandler("onClientRender",getRootElement(),drawMapInfo) end if moveback then movePosition = -2.5 alpha = alpha - 10 end alpha = alpha + 5 if alpha > 255 then alpha = 255 elseif alpha < 0 then alpha = 0 end local heighResize = dxGetFontHeight(1.15, "default-bold") local widthRezise1 = dxGetTextWidth("Map - "..name,1.15,"default-bold") local widthRezise2 = dxGetTextWidth("Lasttime played - "..lastTimePlayed,1.15,"default-bold") local widthRezise3 = dxGetTextWidth("By - "..author,1.15,"default-bold") if widthRezise1 > widthRezise2 and widthRezise1 > widthRezise3 then widthRezise = widthRezise1 elseif widthRezise2 > widthRezise1 and widthRezise2 > widthRezise3 then widthRezise = widthRezise2 elseif widthRezise3 > widthRezise1 and widthRezise3 > widthRezise2 then widthRezise = widthRezise3 end --Background dxDrawImage(screenWidth/2-widthRezise/2-8,position-movePosition-(heighResize-3),widthRezise+16,140+heighResize, "bgr.png",0,0,0,tocolor(200,200,200,alpha)) --Map dxDrawingColorText ( "#FF9900Map - #FFFFFF"..name,screenWidth/2,position-movePosition+heighResize,screenWidth/2,position-movePosition+heighResize, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) --By dxDrawingColorText ( "#FF9900By - #FFFFFF"..author,screenWidth/2,position-movePosition+heighResize*2,screenWidth/2,position-movePosition+heighResize*2, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) --Played dxDrawingColorText ( "#FF9900Played - #FFFFFF"..playedCount.." times",screenWidth/2,position-movePosition+heighResize*3,screenWidth/2,position-movePosition+heighResize*3, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) --Last time dxDrawingColorText ( "#FF9900Lasttime played - #FFFFFF"..lastTimePlayed,screenWidth/2,position-movePosition+heighResize*4,screenWidth/2,position-movePosition+heighResize*4, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) --Mode dxDrawingColorText ( "#FF9900Mode - #FFFFFF"..modename,screenWidth/2,position-movePosition+heighResize*5,screenWidth/2,position-movePosition+heighResize*5, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) position = position - movePosition end function dxDrawingColorText ( text,left,top,right,bottom,color,scale,font,alignX,alignY) fStackOverflow( ) dxDrawingColorText ( text, left+scale, top , right+scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left+scale, top+scale , right+scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left, top+scale , right, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left-scale, top+scale , right-scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left-scale, top , right-scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left-scale, top-scale , right-scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left, top-scale , right, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left+scale, top-scale , right+scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left, top , right, bottom, color,scale,font,alignX,alignY) end ? Copy paste activated? It's example! i did show you your mistake! i think it's easy to understand upper example. You get stack overflow, because you call ( same ) function inside the function! If you not understand it too: 1) Call function fStackOverflow 2) Inside function fStackOverflow call again this function.( fStackOverflow ) 3) Get stack overflow!
  15. Kenix

    stack overflow

    Read all my posts better! It's example
  16. Kenix

    stack overflow

    lol? I give you ( see my last post ). You need fix yourself. You can see you create this function dxDrawingColorText ( text,left,top,right,bottom,color,scale,font,alignX,alignY) dxDrawingColorText ( text, left+scale, top , right+scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left+scale, top+scale , right+scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left, top+scale , right, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left-scale, top+scale , right-scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left-scale, top , right-scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left-scale, top-scale , right-scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left, top-scale , right, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left+scale, top-scale , right+scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) dxDrawingColorText ( text, left, top , right, bottom, color,scale,font,alignX,alignY) end
  17. Kenix

    Some help

    givePlayerMoney
  18. Kenix

    stack overflow

    function fStackOverflow( ) fStackOverflow( ) -- we get stack overflow end fStackOverflow( ) -- call function fStackOverflow http://en.wikipedia.org/wiki/Stack_(abstract_data_type)
  19. You should add arguments to setTimer callback function. addEventHandler ( 'onVehicleEnter', root, function ( uPlayer ) setTimer ( function ( uPlayer, source ) takePlayerMoney ( uPlayer, 1000 ); givePlayerMoney ( getVehicleController ( source ), 1000 ); end, 5000, 0, uPlayer, source ) end )
  20. Check values, return function value, ..
  21. Kenix

    Collision

    Ye, because you get index object ( number ) not element object( userdata ). for nIndex, uObject in pairs ( tObjects ) do setElementCollisionsEnabled ( uObject, false ) end My loop. Your loop. for nIndex, uObject in pairs ( tObjects ) do setElementCollisionsEnabled ( nIndex, false ); end Also t = { 1; ':1'; } print( string.format( '%s %s', t[1], t[2] ) ) -- 1 :1
  22. Did you create request to mysql? Also use /debugscript 3
×
×
  • Create New...