Jump to content

[HELP] How to make a spawn place on ACL


DreaM40BG

Recommended Posts

Posted

Hello, I want ACL "Police" spawn in police base in SF, ACL "Mechanic" spawn in place by me and so more ACLs. Can someone show me how to do it, now I'm using a mod for spawn points for admins and players, but It's compiled. (I have a login system, so spawn after the login) :(

Who help me, I will give him a winning - a League of Legends account (isn't advertisement). :)

Thank you and greetings!

  • Moderators
Posted (edited)

 

-- SERVER SIDE

local aclSpawns = {
	["Police"] = {0, 0, 3},
}

addEventHandler("onPlayerLogin", root, function(_, account)
	for aclname, pos in pairs(aclSpawns) do
		if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then
			setElementPosition(source, pos[1], pos[2], pos[3])
			return
		end
	end
end)

 

something like that

Edited by stPatrick
  • Like 1
Posted (edited)
On 01/12/2019 at 13:47, stPatrick said:

 


-- SERVER SIDE

local aclSpawns = {
	["Police"] = {0, 0, 3},
}

addEventHandler("onPlayerLogin", root, function(_, account)
	for aclname, pos in pairs(aclSpawns) do
		if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then
			setElementPosition(source, pos[1], pos[2], pos[3])
			return
		end
	end
end)

 

something like that

It is working, but how to make different skins for the teams & different weapons and etc.

That's my code now, but the skin isn't working now :(

local aclSpawns = {
	["Everyone"] = {1109, 5131, 16},
	["Police"] = {-1635, 677, -4},
	["Admin"] = {-49, -270, 6}
}

addEventHandler("onPlayerLogin", root, function(_, account)
	for aclname, pos in pairs(aclSpawns) do
		if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then
			setElementPosition(source, pos[1], pos[2], pos[3])
            setPlayerSkin(playerSource, 60)
			giveWeapon ( source, 31, 1000 ) -- Gives the M4 
			giveWeapon ( source, 23, 500 ) -- Gives the Silenced
			giveWeapon ( source, 29, 1200 ) -- Gives the Mp5 weapon 
			return
		end
	end
end)
Edited by DreaM40BG
Posted
6 hours ago, DreaM40BG said:

It is working, but how to make different skins for the teams & different weapons and etc.

That's my code now, but the skin isn't working now :(


local aclSpawns = {
	["Everyone"] = {1109, 5131, 16},
	["Police"] = {-1635, 677, -4},
	["Admin"] = {-49, -270, 6}
}

addEventHandler("onPlayerLogin", root, function(_, account)
	for aclname, pos in pairs(aclSpawns) do
		if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then
			setElementPosition(source, pos[1], pos[2], pos[3])
            setPlayerSkin(playerSource, 60)
			giveWeapon ( source, 31, 1000 ) -- Gives the M4 
			giveWeapon ( source, 23, 500 ) -- Gives the Silenced
			giveWeapon ( source, 29, 1200 ) -- Gives the Mp5 weapon 
			return
		end
	end
end)

Without debugscript 3 you can't go any further. Type /debugscript 3 to check for warnings/errors.

rXldlOR.png

There's no playerSource, replace it with source.

  • Like 1
Posted
3 hours ago, majqq said:

Without debugscript 3 you can't go any further. Type /debugscript 3 to check for warnings/errors.

rXldlOR.png

There's no playerSource, replace it with source.

Ok, but see my code - I want only Police & Admins have weapons and different skins, most the police with "280".

I tried with:

local aclSpawns = {
	["Everyone"] = {1109, 5131, 16}
	["Police"] = {-1635, 677, -4, 29, 2000}
	["Admin"] = {-49, -270, 6}

.....
setElementData(theTeam, weapon, ammo)

But it didn't worked.

But I want more than 1 weapon per team. Now the weapons are working but the players get them too.

Can u help me?

  • Moderators
Posted
-- SERVER SIDE

local aclSpawns = {
	["Everyone"] = {
		pos = {1109, 5131, 16},
		skin = 60,
		weapons = {
			{31, 1000},
			{23, 1000},
			{29, 1000},
		},
	},
	
	["Police"] = {
		pos = {-1635, 677, -4},
		skin = 60,
		weapons = {
			{31, 1000},
			{23, 1000},
			{29, 1000},
		},
	},
	
	["Admin"] = {
		pos = {-49, -270, 6},
		skin = 60,
		weapons = {
			{31, 1000},
			{23, 1000},
			{29, 1000},
		},
	},
}

addEventHandler("onPlayerLogin", root, function(_, account)
	for aclname, data in pairs(aclSpawns) do
		if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then
			setElementPosition(source, data.pos[1], data.pos[2], data.pos[3])
            setElementModel(source, data.skin)
			
			for i, weapon in ipairs(data.weapons) do
				giveWeapon(source, weapon[1], weapon[2])
			end
			
			return
		end
	end
end)

 

  • Thanks 1
Posted
1 hour ago, stPatrick said:

-- SERVER SIDE

local aclSpawns = {
	["Everyone"] = {
		pos = {1109, 5131, 16},
		skin = 60,
		weapons = {
			{31, 1000},
			{23, 1000},
			{29, 1000},
		},
	},
	
	["Police"] = {
		pos = {-1635, 677, -4},
		skin = 60,
		weapons = {
			{31, 1000},
			{23, 1000},
			{29, 1000},
		},
	},
	
	["Admin"] = {
		pos = {-49, -270, 6},
		skin = 60,
		weapons = {
			{31, 1000},
			{23, 1000},
			{29, 1000},
		},
	},
}

addEventHandler("onPlayerLogin", root, function(_, account)
	for aclname, data in pairs(aclSpawns) do
		if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(aclname)) then
			setElementPosition(source, data.pos[1], data.pos[2], data.pos[3])
            setElementModel(source, data.skin)
			
			for i, weapon in ipairs(data.weapons) do
				giveWeapon(source, weapon[1], weapon[2])
			end
			
			return
		end
	end
end)

 

Thank you very much, you fixed everything. The topic can be locked.

  • Like 1

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