Szaphi Posted November 10, 2019 Share Posted November 10, 2019 Help me, i don't know how to determine positions, Now this look like this: faggio1 = createVehicle(403,297.32913, -168.79048, 2.54699, 0, 0, 90) setElementData(faggio, "pojazd_opis", "test \n GBA 421[SA]28") (Pojazd_opis description vehicle) wait(3) if faggio1.position == (403,297.32913, -168.79048, 2.54699, 0, 0, 90) then nil else wait(10) faggio1.position = Vector3.new (403,297.32913, -168.79048, 2.54699, 0, 0, 90) Link to comment
VenomOG Posted November 10, 2019 Share Posted November 10, 2019 Is this even Lua? faggio1 = createVehicle(403,297.32913, -168.79048, 2.54699, 0, 0, 90) setElementData(faggio1, "pojazd_opis", "test \n GBA 421[SA]28") if getElementData(faggio1,"pojazd_opis") then print("it has the data") end Try explaining the code Link to comment
Szaphi Posted November 10, 2019 Author Share Posted November 10, 2019 5 minutes ago, VenomOG said: Is this even Lua? faggio1 = createVehicle(403,297.32913, -168.79048, 2.54699, 0, 0, 90) setElementData(faggio1, "pojazd_opis", "test \n GBA 421[SA]28") if getElementData(faggio1,"pojazd_opis") then print("it has the data") end Try explaining the code Yeah this is Lua but i dunno how explain position so i'll try vector.3 and Faggio1.Position like in unity, I'll try this an another day becaus in my country is night, and i go sleep. Link to comment
Szaphi Posted November 10, 2019 Author Share Posted November 10, 2019 (edited) 1 hour ago, Szaphi said: Help me, i don't know how to determine positions, Now this look like this: faggio1 = createVehicle(403,297.32913, -168.79048, 2.54699, 0, 0, 90) setElementData(faggio, "pojazd_opis", "test \n GBA 421[SA]28") (Pojazd_opis description vehicle) wait(3) if faggio1.position == (403,297.32913, -168.79048, 2.54699, 0, 0, 90) then nil else wait(10) faggio1.position = Vector3.new (403,297.32913, -168.79048, 2.54699, 0, 0, 90) I just want to determine player in car or not in car, and whe palyer are not in vehicle then teleport to create position, if u know what i mean faggio1 = createVehicle(403,297.32913, -168.79048, 2.54699, 0, 0, 90) function VehControllerExit ( x ) player_faggio1 = getVehicleController ( faggio1 ) wait(3) --Maybe someone go drive if ( player_faggio1 ) then --player is here else faggio1.posX = 297.32913 faggio1.posY = -168.79048 faggio1.posZ = 2.54699 end end addEventHandler ( "onTrailerDetach", getRootElement(), VehControllerExit ) this can work? Edited November 10, 2019 by Szaphi Link to comment
JeViCo Posted November 11, 2019 Share Posted November 11, 2019 if ( player_faggio1~=localPlayer) then -- player is not in faggio teleport vehicle to player setElementPosition(faggio1, x, y, z) 1 Link to comment
Szaphi Posted November 16, 2019 Author Share Posted November 16, 2019 (edited) Okay, Thank, But i have another problem, I dunno how to do acl group " if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Policja" ) ) then" And i need help, how do gorup acl policja - police Edited November 16, 2019 by Szaphi Link to comment
JeViCo Posted November 17, 2019 Share Posted November 17, 2019 you mean this? if not isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Policja" ) ) then return end Link to comment
Szaphi Posted November 17, 2019 Author Share Posted November 17, 2019 (edited) I mean how add player to acl gorup and how do acl gorup and I can do something like this: Function addVip() something (xD) end addCommandHandler ( "giveVip", add|Vip() )?| |This script for i need a Acl gorup function kajdankii ( player, cmd, gracz ) local playerName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Policja" ) ) then setAccountData(getPlayerAccount(getPlayerFromName(gracz)), "kajdanki", true) toggleControl(getPlayerFromName(gracz), "sprint", false ) toggleControl(getPlayerFromName(gracz), "jump", false ) toggleControl(getPlayerFromName(gracz), "aim_weapon", false ) toggleControl(getPlayerFromName(gracz), "fire", false ) toggleControl(getPlayerFromName(gracz), "crouch", false ) outputChatBox("#0078FFU U put on handcuss",player,255, 0, 0, true) outputChatBox("#0078FFPoliceman put on u handcuffs",gracz,255, 0, 0, true) | kajdanki = handcuffs Edited November 17, 2019 by Szaphi Link to comment
JeViCo Posted November 17, 2019 Share Posted November 17, 2019 function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end addCommandHandler("addVip", function(pl, cmd, ...) local nick = table.concat({...}, " ") local player = getPlayerFromPartialName(nick) if not player then return end local accName = getAccountName(player) aclGroupAddObject(aclGetGroup("Vip"), "user."..accName) end) Try this code Link to comment
Szaphi Posted December 11, 2019 Author Share Posted December 11, 2019 Don't work, i try modify but nothing ;/ On 17/11/2019 at 21:20, JeViCo said: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end addCommandHandler("addVip", function(pl, cmd, ...) local nick = table.concat({...}, " ") local player = getPlayerFromPartialName(nick) if not player then return end local accName = getAccountName(player) aclGroupAddObject(aclGetGroup("Vip"), "user."..accName) end) Try this code Link to comment
JeViCo Posted December 14, 2019 Share Posted December 14, 2019 addCommandHandler("addVip", function(pl, cmd, ...) local nick = table.concat({...}, " ") local player = getPlayerFromPartialName(nick) if not player then return end local acc = getPlayerAccount(player) local accName = getAccountName(acc) aclGroupAddObject(aclGetGroup("Vip"), "user."..accName) aclReload() -- apply changes end, true) Mistake was there: getAccountName(player) I used player element instead of account By the way, don't forget to add command.addVip permission to use command 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