Jump to content

help with Spawn Protect


Kenix

Recommended Posts

please help me a lot to do spawn protect script but due to the anti-cheat MTA he kick a player.

  
function saveSpawn ( ) 
  startSaveSpawn() 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), saveSpawn ) 
  
function startSaveSpawn () 
noSpawnKill = exports.extrahealth:setElementExtraHealth ( getLocalPlayer(), 100000 )  
setElementAlpha(getLocalPlayer(), 50) 
  setTimer(removeSaveSpawn,8000,1) 
end 
  
function removeSaveSpawn () 
exports.extrahealth:takeElementExtraHealth(getLocalPlayer(),noSpawnKill) 
setElementAlpha(getLocalPlayer(), 255) 
end 
  

Link to comment

i have this script but I still kick

  
function saveSpawn ( ) 
  startSaveSpawn() 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), saveSpawn ) 
  
function startSaveSpawn () 
setElementAlpha(getLocalPlayer(), 50) 
 setElementData(getLocalPlayer() , "sp_prot", true );  
  setTimer(removeSaveSpawn,8000,1) 
end 
  
function removeSaveSpawn () 
setElementData(getLocalPlayer() , "sp_prot", false );  
setElementAlpha(getLocalPlayer(), 255) 
end 
  
function saveSpawn ( ) 
if getElementData( source, "sp_prot" ) then cancelEvent() end; 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), saveSpawn ) 
  

Link to comment
If you won't be kicked, you must disable that anti cheat part at mtaserver.conf (i forgot which number was the AC for this)

No but as you can get around like a cheat I know that some servers have a script spawn protect.

likely to script is not correct :(

Link to comment

i am fixed

  
function saveSpawn ( ) 
 setElementData(getLocalPlayer() , "sp_prot", true );  
 setElementAlpha(getLocalPlayer(), 50) 
  setTimer(removeSaveSpawn,8000,1) 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), saveSpawn ) 
  
function removeSaveSpawn () 
setElementData(getLocalPlayer() , "sp_prot", false );  
setElementAlpha(getLocalPlayer(), 255) 
end 
  
function onSaveSpawn ( ) 
if getElementData( getLocalPlayer(), "sp_prot" ) then cancelEvent() end; 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), onSaveSpawn ) 
  

but now appears another error anti cheat sometimes kick and when you spawn and shoot at you then you have 0 hp and 8 seconds later you die. = (

Link to comment

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