Jump to content

blipplayer problem.


Wei

Recommended Posts

Posted

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) 

Posted

function 'createBlipAttactedTo' not exists -_-

Also, why you make variable 'playerblip' local?

P.S Tabulate your code please!

Posted
function 'createBlipAttactedTo' not exists -_-

Also, why you make variable 'playerblip' local?

P.S Tabulate your code please!

How to tabulate code ?

Posted

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) 

Guest Guest4401
Posted

Did you know that events are case sensitive?

Change

onClientGuiClick 

to

onClientGUIClick 

Posted

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

Posted (edited)
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
Posted
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) 
         

?

Posted

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  

Posted
    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 ?

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