Jump to content

Acl Spawnpoint | SOLVED


Recommended Posts

Posted (edited)
addEventHandler( "onResourceStart", resourceRoot, 
  function() 
      resetMapInfo() 
       for _,player in ipairs( getElementsByType 'player' ) do 
        spawn( player ) 
      end 
   end 
) 
      
function spawn( player ) 
  if not isElement( player ) then return end 
     showChat( player, true ) 
     local acc = getPlayerAccount( player ) 
      if acc and not isGuestAccount( acc ) then 
         if isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Forever" ) ) then 
            spawnPlayer ( player, 220.19960021973, 1825.8579101563, 6.4140625, 0, 45 ) 
         elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Monster Energy" ) ) then 
            spawnPlayer ( player, 1146.5582509766, 2334.53515625, 10.829927444458 , 90, 228) 
         elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Saint Rows" ) ) then 
            spawnPlayer ( player, 2481.5187988281, 2356.2329101563, 4.2109375, 90, 17) 
 elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Iron Weasel" ) ) then 
            spawnPlayer ( player, 1075.8477783203, 1252.1403808594, 10.8203125, 90, 17) 
       end 
      
     end 
      fadeCamera( player, true ) 
      setCameraTarget( player, player ) 
end 
      
addEventHandler( "onPlayerJoin", root, 
  function( ) 
    spawn( source ) 
end) 
      
addEventHandler( "onPlayerWasted", root, 
  function( ) 
     setTimer( spawn, 500, 1, source ) 
end) 

The trouble is when a default player join the game he dont spawn at the locations of spawn like groove or ganton or missionary hills or pirate ship, Help please

Edited by Guest

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

This resource work only if i disable play gamemode but default player dont spawn

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

you have a lot mistakes

addEventHandler( "onResourceStart", resourceRoot, 
  function( player ) 
      resetMapInfo() 
       for _,player in ipairs( getElementsByType ("player") ) do 
        spawn( player ) 
      end 
   end 
) 
      
function spawn( player ) 
  if not isElement( player ) then return end 
     showChat( player, true ) 
     local acc = getPlayerAccount( player ) 
      if acc and not isGuestAccount( acc ) then 
         if isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Forever" ) ) then 
            spawnPlayer ( player, 220.19960021973, 1825.8579101563, 6.4140625, 0, 45 ) 
         elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Monster Energy" ) ) then 
            spawnPlayer ( player, 1146.5582509766, 2334.53515625, 10.829927444458 , 90, 228) 
         elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Saint Rows" ) ) then 
            spawnPlayer ( player, 2481.5187988281, 2356.2329101563, 4.2109375, 90, 17) 
 elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Iron Weasel" ) ) then 
            spawnPlayer ( player, 1075.8477783203, 1252.1403808594, 10.8203125, 90, 17) 
       end 
      
     end 
      fadeCamera( player, true ) 
      setCameraTarget( player, player ) 
end 
      
addEventHandler( "onPlayerLogin", root, 
  function( ) 
    spawn( source ) 
end) 
      
addEventHandler( "onPlayerWasted", root, 
  function( ) 
     setTimer( spawn, 500, 1, source ) 
end) 

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted

if i runned play can it work ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

You would need to edit "play" script.

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

Oh how ?

can you send me a lua example

?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Replace the content of "play/broph.lua" with:

local spawnpoint 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        spawnpoint = getRandomSpawnPoint() 
        resetMapInfo() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 
    if not isElement(player) then return end 
    local acc = getPlayerAccount( player ) 
    if acc and not isGuestAccount( acc ) then 
        if isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Forever" ) ) then 
            spawnPlayer ( player, 220.19960021973, 1825.8579101563, 6.4140625, 0, 45 ) 
        elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Monster Energy" ) ) then 
            spawnPlayer ( player, 1146.5582509766, 2334.53515625, 10.829927444458 , 90, 228) 
        elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Saint Rows" ) ) then 
            spawnPlayer ( player, 2481.5187988281, 2356.2329101563, 4.2109375, 90, 17) 
        elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "Iron Weasel" ) ) then 
            spawnPlayer ( player, 1075.8477783203, 1252.1403808594, 10.8203125, 90, 17) 
        else 
            if get("spawnreset") == "onSpawn" then 
                spawnpoint = getRandomSpawnPoint() 
            end 
            exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) 
            repeat until setElementModel(player,math.random(312)) 
        end 
    end 
  
    showChat(player, true) 
    fadeCamera( player, true ) 
    setCameraTarget( player, player ) 
end 
  
function getRandomSpawnPoint () 
    local spawnpoints = getElementsByType("spawnpoint") 
    return spawnpoints[math.random(1,#spawnpoints)] 
end 
  
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
    end 
) 
  
addEventHandler("onPlayerQuit",root, 
    function () 
        if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then 
            spawnpoint = getRandomSpawnPoint() 
        end 
    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
) 

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

Thanks :)

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

You're welcome.

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 i ask?

it wont remove the default players spawnpoint ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

No, it'll spawn players in default spawnpoints if they aren't on these ACL groups.

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

Ok thanks

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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