1LoL1 Posted March 8, 2014 Share Posted March 8, 2014 (edited) Please someone help me .. did not someone make a script to write /bloodall = it gives each player on the server 12000 Blood /FIXALL = fix all the cars on the server I just created a script / blood that it will complement my 12 000 Blood but do not know how to give each player and that's typed into the chat Admin has healed all player Admin fix all cars Edited March 8, 2014 by Guest Link to comment
Castillo Posted March 8, 2014 Share Posted March 8, 2014 Loop every player. You can get a table with the online players with the function: getElementsByType ( "player" ) Then you can use a for-loop. http://www.lua.org/pil/4.3.4.html Link to comment
1LoL1 Posted March 8, 2014 Author Share Posted March 8, 2014 Loop every player. You can get a table with the online players with the function: getElementsByType ( "player" ) Then you can use a for-loop. http://www.lua.org/pil/4.3.4.html You better lock still do not understand Link to comment
Castillo Posted March 8, 2014 Share Posted March 8, 2014 Don't take this the wrong way, but what are you doing in this section if you have no intentions of learning? Link to comment
1LoL1 Posted March 8, 2014 Author Share Posted March 8, 2014 Don't take this the wrong way, but what are you doing in this section if you have no intentions of learning? But I'm learning to script but somehow I do not .. Link to comment
Castillo Posted March 8, 2014 Share Posted March 8, 2014 Can't you at least give it a try? if it doesn't work, you post it here and we'll help you. Link to comment
1LoL1 Posted March 8, 2014 Author Share Posted March 8, 2014 Can't you at least give it a try? if it doesn't work, you post it here and we'll help you. But I know just do /blood and /fix single player but for the entire server I do not know but I tried hopelessly These are the scripts function kill (source) setElementData ( source, "blood", -2000 ) end addCommandHandler ( "kill", kill ) function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if theVehicle and getVehicleController ( theVehicle ) == playerSource then fixVehicle (theVehicle) outputChatBox ("" , thePlayer) end end addCommandHandler ("fix" , fix) Link to comment
Moderators Citizen Posted March 9, 2014 Moderators Share Posted March 9, 2014 I don't want to bypass what Solidsnake is trying to do but here is two hints: getElementsByType ( "player" ) returns a table that contains all players element on the server for index, value in ipairs ( myTable ) do end Is a lua loop that will iterate over myTable. For each loop (1 loop per value in the table) index will contain the position the loop is at in the table (1, 2, 3 ...) and value will contain the value and the position in the table. If it's the 3rd loop, then index = 3 and value will be the 3rd value in the list. Link to comment
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