Jump to content

why money same for all ?


Wei

Recommended Posts

Posted
money_TAB = guiGridListAddColumn( GUIEditor_Grid[1], "Money", 0.10 ) 

guiGridListSetItemText ( GUIEditor_Grid[1], row, money_TAB, getPlayerMoney( cPlayer ), false, false ) 

cPlayer are all players

Diet with russian vodka, lose 3 days in one week !

Posted
for index, cPlayer in pairs(getElementsByType( "player" )) do 

Yeah it is containing playerss

Diet with russian vodka, lose 3 days in one week !

Posted

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 

Posted

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 

Diet with russian vodka, lose 3 days in one week !

Posted

Alpha, but getPlayerMoney() also is server-side. Why it only gets the money of the localPlayer?

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

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

Diet with russian vodka, lose 3 days in one week !

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

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

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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