Jump to content

why money same for all ?


Wei

Recommended Posts

You have to loop through all players, and add a row for each player with his name:

for index, cPlayer in pairs(getElementsByType( "player" )) do 
  local row = guiGridListAddRow(GUIEditor_Grid[1]) 
  guiGridListSetItemText ( GUIEditor_Grid[1], row, money_TAB, tostring(getPlayerMoney( cPlayer )), false, false ) 
end 

Link to comment

I have:

function RefreshTab() 
    guiGridListClear (GUIEditor_Grid[1]) 
    for index, cPlayer in pairs(getElementsByType( "player" )) do 
    row = guiGridListAddRow (GUIEditor_Grid[1]) 
    guiGridListSetItemText ( GUIEditor_Grid[1], row, player_TAB, getPlayerName(cPlayer), false, false ) 
    guiGridListSetItemText ( GUIEditor_Grid[1], row, money_TAB, getPlayerMoney( cPlayer ), false, false ) 
end 
end 

Link to comment
function createCarrou (hitPlayer) 
    if getElementModel( hitPlayer ) == 28 then 
        x, y, z = unpackCarjacker() 
        vehicle = createVehicle ( 541,x, y, z ) 
        carBlip = createBlipAttachedTo ( vehicle, 53 ) 
        addEventHandler ( "onVehicleEnter", vehicle, carHit ) 
    end 
end 
addCommandHandler("jacker", createCarrou) 

how can I make the blip visible only to the player ?

Link to comment
function createCarrou (hitPlayer) 
    if getElementModel( hitPlayer ) == 28 then 
        x, y, z = unpackCarjacker() 
        vehicle = createVehicle ( 541,x, y, z ) 
        carBlip = createBlipAttachedTo ( vehicle, 53 ) 
        addEventHandler ( "onVehicleEnter", vehicle, carHit ) 
    end 
end 
addCommandHandler("jacker", createCarrou) 

how can I make the blip visible only to the player ?

createBlipAttachedTo ( vehicle, 53, 2, 255, 0, 0, 255, 0, 99999.0, hitPlayer) 

Link to comment
for index, cPlayer in PAIRS(getElementsByType( "player" )) do 
  local row = guiGridListAddRow(GUIEditor_Grid[1]) 
  guiGridListSetItemText ( GUIEditor_Grid[1], row, money_TAB, tostring(getPlayerMoney( cPlayer )), false, false ) 
end 

Did you see your error, Alpha?

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