Jump to content

blipplayer problem.


Wei

Recommended Posts

What's the problem?

No debug errors!

function clientClickGuiDoThat ( ) 
if ( source == blipbutplayer ) then 
        row, col = guiGridListGetSelectedItem ( source ) 
        if ( row and col and row ~= -1 and col ~= -1 ) then 
        local playerblip = createBlipAttactedTo( localPlayer ) 
        else 
        destroyElement(playerblip) 
    end 
  end 
end 
addEventHandler("onClientGuiClick", root, clientClickGuiDoThat) 

Link to comment

Maybe

function clientClickGuiDoThat ( ) 
if ( source == blipbutplayer ) then 
        row, col = guiGridListGetSelectedItem ( source ) 
        if ( row and col and row ~= -1 and col ~= -1 ) then 
        local playerblip = createBlipAttachedTo( localPlayer ) 
        else 
        destroyElement(playerblip) 
    end 
  end 
end 
addEventHandler("onClientGuiClick", root, clientClickGuiDoThat) 

Link to comment

now it works.

if ( source == blipbutplayer ) then 
        select = guiGridListGetSelectedItem ( playerlistgrid ) 
        if select then 
        playerblip = createBlipAttachedTo( localPlayer, 58 ) 
        else 
        destroyElement(playerblip) 
    end 
  end 
end 
addEventHandler("onClientGUIClick", root, clientClickGuiDoThat) 
         

but idk how to destoy it

Link to comment
now it works.
if ( source == blipbutplayer ) then 
        select = guiGridListGetSelectedItem ( playerlistgrid ) 
        if select then 
        playerblip = createBlipAttachedTo( localPlayer, 58 ) 
        else 
        destroyElement(playerblip) 
    end 
  end 
end 
addEventHandler("onClientGUIClick", root, clientClickGuiDoThat) 
         

but idk how to destoy it

OFFTOPIC: Again you not tabulate code :/

I gave you link. Why you not read?

but idk how to destoy it
destroyElement 

Edited by Guest
Link to comment
now it works.
if ( source == blipbutplayer ) then 
        select = guiGridListGetSelectedItem ( playerlistgrid ) 
        if select then 
        playerblip = createBlipAttachedTo( localPlayer, 58 ) 
        else 
        destroyElement(playerblip) 
    end 
  end 
end 
addEventHandler("onClientGUIClick", root, clientClickGuiDoThat) 
         

but idk how to destoy it

OFFTOPIC: Again you not tabulate code :/

I gave you link. Why you not read?

function clientClickGuiDoThat ( ) 
if ( source == blipbutplayer ) then 
        select = guiGridListGetSelectedItem ( playerlistgrid ) 
        if select then 
        return true 
        playerblip = createBlipAttachedTo( localPlayer, 58 ) 
        else 
        return false 
        destroyElement(playerblip) 
    end 
  end 
end 
addEventHandler("onClientGUIClick", root, clientClickGuiDoThat) 
         

?

Link to comment

read the post

TAB(ulate) button

Recommended coding design

When you are coding, it is recommend to indent (by using TAB or four spaces) lines as per the scope, see the example below.

  
  
local scope1 = math.random(3) 
local debug = 1 
if scope1 == 1 then-- new scope 
    if debug == 1 then 
       outputDebugString("Testing feature 'balls'") 
       if balls then 
          outputDebugString('Balls were ripped') 
       else 
          outputDebugString('Balls survived') 
       end 
     end 
end  

Link to comment
    if ( source == blipbutplayer ) then 
      select = guiGridListGetSelectedItem ( playerlistgrid ) 
        if select then 
           playerblip = createBlipAttachedTo( localPlayer, 58 ) 
        else 
           destroyElement(playerblip) 
        end 
    end 
end 
addEventHandler("onClientGUIClick", root, clientClickGuiDoThat) 

@Kenix

Thats better ?

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...