Wei Posted May 27, 2012 Posted May 27, 2012 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 !
Alpha Posted May 27, 2012 Posted May 27, 2012 How come cPlayer is all players? Is it a table containing players? My Resources: [REL] Support System v1.0.2
Wei Posted May 27, 2012 Author Posted May 27, 2012 for index, cPlayer in pairs(getElementsByType( "player" )) do Yeah it is containing playerss Diet with russian vodka, lose 3 days in one week !
Alpha Posted May 27, 2012 Posted May 27, 2012 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 My Resources: [REL] Support System v1.0.2
Wei Posted May 27, 2012 Author Posted May 27, 2012 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 !
Alpha Posted May 27, 2012 Posted May 27, 2012 (edited) I forgot, clientside getPlayerMoney can only get the money of the localPlayer. https://wiki.multitheftauto.com/wiki/GetPlayerMoney Edited May 27, 2012 by Guest My Resources: [REL] Support System v1.0.2
Stanley Sathler Posted May 27, 2012 Posted May 27, 2012 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
Alpha Posted May 27, 2012 Posted May 27, 2012 I meant clientside getPlayerMoney can only get the money of the localPlayer, while serverside can get any player's money. My Resources: [REL] Support System v1.0.2
Wei Posted May 28, 2012 Author Posted May 28, 2012 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 !
Guest Guest4401 Posted May 28, 2012 Posted May 28, 2012 If you are using this clientside then only that person will see it. If you are using it server side, then take a look at the visibleTo argument https://wiki.multitheftauto.com/wiki/Cre ... AttachedTo
Flaker Posted May 28, 2012 Posted May 28, 2012 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)
Castillo Posted May 28, 2012 Posted May 28, 2012 There's also a function called: setElementVisibleTo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Anderl Posted May 28, 2012 Posted May 28, 2012 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
Wei Posted May 28, 2012 Author Posted May 28, 2012 Thanks all! Diet with russian vodka, lose 3 days in one week !
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now