Jump to content

DayZ Help me


1LoL1

Recommended Posts

Posted (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 by Guest
Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Don't take this the wrong way, but what are you doing in this section if you have no intentions of learning?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

Posted

Can't you at least give it a try? if it doesn't work, you post it here and we'll help you.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

  • Moderators
Posted

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.

The rEvolution is coming ...

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