Jump to content

KIll all players


Xwad

Recommended Posts

Posted

how can i kill all players with a command? i know there is a function killPed, but i want to kill all players on the server with that function. Is there any function to get all players on the server? Thanks

Posted

thanks. I made a script , but its not working:/

  
function killAllPlayers () 
local players = getElementsByType ( "ped" ) 
for theKey,thePlayer in ipairs(players) do 
killPed ( players, players ) 
end 
end 
addCommandHandler ( "k", killAllPlayers ) 
  

Posted

replace "ped" with "player".

1c268fb797.png

and put your code server side.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Try this on server side :v

  
function killAllPlayers() 
local players = getElementsByType("ped") 
 for I = 1, #players do 
  local p = players[I] 
  killPed( p, p ) 
 end 
end 
addCommandHandler( "k", killAllPlayers ) 
  

"Keep making it simplex."

Posted

Why do you need it on client side?

Client Side

  
function killSuckers() 
 triggerServerEvent('onPlayerWantsToKillSuckas', localPlayer) 
end 
addCommandHandler('killSuckas', killSuckers) 
  

Server Side

  
addEvent('onPlayerWantsToKillSuckas', true) 
  
function killSuckas() 
 local suckas = getElementsByType('ped') 
 for i = 1, #suckas do 
  killPed(suckas[i], suckas[i]) 
 end 
end 
addEventHandler('onPlayerWantsToKillSuckas', root, killSuckas) 
  

"Keep making it simplex."

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