DreaM40BG Posted November 23, 2019 Share Posted November 23, 2019 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! Link to comment
DreaM40BG Posted December 1, 2019 Author Share Posted December 1, 2019 Please somebody? Link to comment
Moderators Patrick Posted December 1, 2019 Moderators Share Posted December 1, 2019 (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 December 1, 2019 by stPatrick 1 Link to comment
DreaM40BG Posted December 6, 2019 Author Share Posted December 6, 2019 (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 December 6, 2019 by DreaM40BG Link to comment
Scripting Moderators ds1-e Posted December 7, 2019 Scripting Moderators Share Posted December 7, 2019 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. There's no playerSource, replace it with source. 1 Link to comment
DreaM40BG Posted December 7, 2019 Author Share Posted December 7, 2019 3 hours ago, majqq said: Without debugscript 3 you can't go any further. Type /debugscript 3 to check for warnings/errors. 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? Link to comment
Moderators Patrick Posted December 7, 2019 Moderators Share Posted December 7, 2019 -- 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) 1 Link to comment
DreaM40BG Posted December 7, 2019 Author Share Posted December 7, 2019 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. 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now