Jump to content

Bug or my mistake? oO


drk

Recommended Posts

I'm using onClientMouseEnter and onClientMouseLeave but when I map stop and start other event's don't work anymore :shock:

Here the code:

addEventHandler('onClientMouseEnter',root, 
    function() 
        if source == contacts then 
            guiSetVisible ( ipad['contacts_label'], true ) 
        elseif source == music then 
            guiSetVisible ( ipad['music_label'], true ) 
        elseif source == profile then 
            guiSetVisible ( ipad['profile_label'], true ) 
        elseif source == settings then 
            guiSetVisible ( ipad['settings_label'], true ) 
        elseif source == sms then 
            guiSetVisible ( ipad['sms_label'], true ) 
        elseif source == stats then 
            guiSetVisible ( ipad['stats_label'], true ) 
        elseif source == top then 
            guiSetVisible ( ipad['top_label'], true ) 
        end 
    end 
) 
  
addEventHandler('onClientMouseLeave',root, 
    function() 
        if source == contacts then 
            guiSetVisible ( ipad['contacts_label'], false ) 
        elseif source == music then 
            guiSetVisible ( ipad['music_label'], false ) 
        elseif source == profile then 
            guiSetVisible ( ipad['profile_label'], false ) 
        elseif source == settings then 
            guiSetVisible ( ipad['settings_label'], false ) 
        elseif source == sms then 
            guiSetVisible ( ipad['sms_label'], false ) 
        elseif source == stats then 
            guiSetVisible ( ipad['stats_label'], false ) 
        elseif source == top then 
            guiSetVisible ( ipad['top_label'], false ) 
        end 
    end 
) 
  

GUI:

    ipad['window'] = guiCreateStaticImage((93/800)*x,(-430/600)*y,(607/800)*x,(412/600)*y,'_utils/_data/_image/ipad.png',false) 
    ipad['close'] = guiCreateLabel((529/800)*x,(191/600)*y,(31/800)*x,(27/600)*y,'',false,ipad['window']) 
    ipad['topbar'] = guiCreateStaticImage((89/800)*x,(10/600)*y,(429/800)*x,(78/600)*y,'_utils/_data/_image/task-bar.png',false,ipad['window']) 
    ipad['topbar_time'] = guiCreateLabel((383/800)*x,(36/600)*y,(45/800)*x,(14/600)*y,'',false,ipad['topbar']) 
    guiLabelSetVerticalAlign(ipad['topbar_time'],"center") 
    guiLabelSetHorizontalAlign(ipad['topbar_time'],"center",false) 
    guiSetFont(ipad['topbar_time'],wsCFont) 
  
    ipad['news'] = guiCreateLabel((89/800)*x,(340/600)*y,(429/800)*x,(23/600)*y,"",false,ipad['window']) 
    guiSetAlpha(ipad['news'],0.80000001192093) 
    guiLabelSetColor(ipad['news'],0,0,0,100) 
    guiLabelSetVerticalAlign(ipad['news'],"center") 
    guiLabelSetHorizontalAlign(ipad['news'],"center",false) 
    guiSetFont(ipad['news'],newsFont) 
    --ipad['top'] = guiCreateStaticImage((93/800)*x,(16/600)*y,(607/800)*x,(412/600)*y,"_utils/_data/_image/top.png",false,ipad['window']) 
    --ipad['top2'] = guiCreateStaticImage((89/800)*x,(10/600)*y,(429/800)*x,(78/600)*y,"_utils/_data/_image/top.png",false,ipad['top']) 
    --ipad['top3'] = guiCreateStaticImage((119/800)*x,(-136/600)*y,(429/800)*x,(23/600)*y,"_utils/_data/_image/top.png",false,ipad['top2']) 
    ipad['contacts'] = guiCreateStaticImage((52/800)*x,(68/600)*y,(173/800)*x,(103/600)*y,"_utils/_data/_image/contacts.png",false,ipad['window']) 
    ipad['music'] = guiCreateStaticImage((104/800)*x,(68/600)*y,(170/800)*x,(103/600)*y,"_utils/_data/_image/music.png",false,ipad['window']) 
    ipad['profile'] = guiCreateStaticImage((145/800)*x,(65/600)*y,(193/800)*x,(110/600)*y,"_utils/_data/_image/profile.png",false,ipad['window']) 
    ipad['settings'] = guiCreateStaticImage((194/800)*x,(63/600)*y,(203/800)*x,(116/600)*y,"_utils/_data/_image/settings.png",false,ipad['window']) 
    ipad['shutoff'] = guiCreateStaticImage((229/800)*x,(254/600)*y,(159/800)*x,(96/600)*y,"_utils/_data/_image/shutoff.png",false,ipad['window']) 
    ipad['sms'] = guiCreateStaticImage((261/800)*x,(65/600)*y,(180/800)*x,(113/600)*y,"_utils/_data/_image/sms.png",false,ipad['window']) 
    ipad['stats'] = guiCreateStaticImage((302/800)*x,(61/600)*y,(201/800)*x,(121/600)*y,"_utils/_data/_image/stats.png",false,ipad['window']) 
    ipad['top'] = guiCreateStaticImage((367/800)*x,(63/600)*y,(183/800)*x,(117/600)*y,"_utils/_data/_image/top.png",false,ipad['window']) 
    ipad['state'] = guiCreateLabel((102/800)*x,(193/600)*y,(403/800)*x,(52/600)*y,'',false,ipad['window']) 
    guiSetAlpha(ipad['state'],0.80000001192093) 
    guiLabelSetColor(ipad['state'],0,0,0,100) 
    guiLabelSetVerticalAlign(ipad['state'],"center") 
    guiLabelSetHorizontalAlign(ipad['state'],"center",false) 
    guiSetFont(ipad['state'],stateFont) 
  
    contacts = guiCreateLabel((216/800)*x,(114/600)*y,(31/800)*x,(42/600)*y,"",false) 
    music = guiCreateLabel((267/800)*x,(114/600)*y,(30/800)*x,(43/600)*y,"",false) 
    profile = guiCreateLabel((317/800)*x,(113/600)*y,(34/800)*x,(47/600)*y,"",false) 
    settings = guiCreateLabel((369/800)*x,(113/600)*y,(38/800)*x,(49/600)*y,"",false) 
    sms = guiCreateLabel((426/800)*x,(114/600)*y,(36/800)*x,(49/600)*y,"",false) 
    stats = guiCreateLabel((475/800)*x,(112/600)*y,(40/800)*x,(53/600)*y,"",false) 
    top = guiCreateLabel((534/800)*x,(113/600)*y,(34/800)*x,(51/600)*y,"",false) 
  
    guiBringToFront(contacts) 
    guiBringToFront(music) 
    guiBringToFront(profile) 
    guiBringToFront(settings) 
    guiBringToFront(sms) 
    guiBringToFront(stats) 
    guiBringToFront(top) 
  
    ipad['contacts_label'] = guiCreateLabel((207/800)*x,(95/600)*y,(51/800)*x,(15/600)*y,"Contacts",false) 
    guiSetAlpha(ipad['contacts_label'],0.89999997615814) 
    guiLabelSetColor(ipad['contacts_label'],0,0,0,100) 
    guiSetFont(ipad['contacts_label'],wsCFont) 
  
    ipad['music_label'] = guiCreateLabel((258/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"Music",false) 
    guiSetAlpha(ipad['music_label'],0.89999997615814) 
    guiLabelSetColor(ipad['music_label'],0,0,0) 
    guiLabelSetVerticalAlign(ipad['music_label'],"center") 
    guiLabelSetHorizontalAlign(ipad['music_label'],"center",false) 
    guiSetFont(ipad['music_label'],wsCFont) 
  
    ipad['profile_label'] = guiCreateLabel((310/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"Profile",false) 
    guiSetAlpha(ipad['profile_label'],0.89999997615814) 
    guiLabelSetColor(ipad['profile_label'],0,0,0) 
    guiLabelSetVerticalAlign(ipad['profile_label'],"center") 
    guiLabelSetHorizontalAlign(ipad['profile_label'],"center",false) 
    guiSetFont(ipad['profile_label'],wsCFont) 
  
    ipad['settings_label'] = guiCreateLabel((366/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"Settings",false) 
    guiSetAlpha(ipad['settings_label'],0.89999997615814) 
    guiLabelSetColor(ipad['settings_label'],0,0,0) 
    guiSetFont(ipad['settings_label'],wsCFont) 
  
    ipad['sms_label'] = guiCreateLabel((419/800)*x,(94/600)*y,(51/800)*x,(15/600)*y,"SMS",false) 
    guiSetAlpha(ipad['sms_label'],0.89999997615814) 
    guiLabelSetColor(ipad['sms_label'],0,0,0) 
    guiLabelSetHorizontalAlign(ipad['sms_label'],"center",false) 
    guiSetFont(ipad['sms_label'],wsCFont) 
  
    ipad['stats_label'] = guiCreateLabel((470/800)*x,(92/600)*y,(51/800)*x,(15/600)*y,"Stats",false) 
    guiSetAlpha(ipad['stats_label'],0.89999997615814) 
    guiLabelSetColor(ipad['stats_label'],0,0,0) 
    guiLabelSetVerticalAlign(ipad['stats_label'],"center") 
    guiLabelSetHorizontalAlign(ipad['stats_label'],"center",false) 
    guiSetFont(ipad['stats_label'],wsCFont) 
  
    ipad['top_label'] = guiCreateLabel((525/800)*x,(93/600)*y,(51/800)*x,(15/600)*y,"Top",false) 
    guiSetAlpha(ipad['top_label'],0.89999997615814) 
    guiLabelSetColor(ipad['top_label'],0,0,0) 
    guiLabelSetHorizontalAlign(ipad['top_label'],"center",false) 
    guiSetFont(ipad['top_label'],wsCFont) 
  
    local rand = news[math.random(#news)] 
    guiSetText(ipad['news'],tostring(rand)) 
    setTimer( 
        function() 
            local rand = news[math.random(#news)] 
            guiSetText(ipad['news'],tostring(rand)) 
        end, 
    3600000,0) 
  
    guiSetVisible ( ipad['window'], true ) 
    state = false 

Link to comment

I mean check this.

addEventHandler('onClientMouseEnter',root, 
    function() 
        if source == contacts then 
            guiSetVisible ( ipad['contacts_label'], true ) 
        elseif source == music then 
            guiSetVisible ( ipad['music_label'], true ) 
        elseif source == profile then 
            guiSetVisible ( ipad['profile_label'], true ) 
        elseif source == settings then 
            guiSetVisible ( ipad['settings_label'], true ) 
        elseif source == sms then 
            guiSetVisible ( ipad['sms_label'], true ) 
        elseif source == stats then 
            guiSetVisible ( ipad['stats_label'], true ) 
        elseif source == top then 
            guiSetVisible ( ipad['top_label'], true ) 
        end 
    end 
) 
  
addEventHandler('onClientMouseLeave',root, 
    function() 
        if source == contacts then 
            guiSetVisible ( ipad['contacts_label'], false ) 
        elseif source == music then 
            guiSetVisible ( ipad['music_label'], false ) 
        elseif source == profile then 
            guiSetVisible ( ipad['profile_label'], false ) 
        elseif source == settings then 
            guiSetVisible ( ipad['settings_label'], false ) 
        elseif source == sms then 
            guiSetVisible ( ipad['sms_label'], false ) 
        elseif source == stats then 
            guiSetVisible ( ipad['stats_label'], false ) 
        elseif source == top then 
            guiSetVisible ( ipad['top_label'], false ) 
        end 
    end 
) 
  

Conditions and etc.

Maybe not exists.

Just try.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...