Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I don't get what do you mean, I only know that when you must stop the server before editing it. P.S: There's a function to reload the ACL in-game: aclReload(), doesn't require server restart or anything. But you need to know how to execute it of course.
  2. Castillo

    staff

    That's not from this script, I tested and no errors.
  3. That's the problem, FIRST stop the server THEN edit the ACL and start the server again.
  4. Castillo

    staff

    As I supposed, you didn't get me, or you didn't read careful. col = createColTube (-1683.0999755859, -2881.1000976563, 50.400001525879, 10, 3) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. root = getRootElement () cone1 = createObject ( 1237, -1679.099609375, -2884.099609375, 51.099998474121, 0, 0, 311.99523925781) -- enter the ID of the object followed by the coordinates cone2 = createObject ( 1237, -1681.5, -2881.7998046875, 51.099998474121, 0, 0, 311.99523925781) cone3 = createObject ( 1237, -1684.19921875, -2879.3994140625, 51.099998474121, 0, 0, 311.99523925781) cone4 = createObject ( 1237, -1686.7998046875, -2877, 51.099998474121, 0, 0, 311.99523925781) gate1 = createObject ( 980, -1683, -2881.19921875, 54, 0, 0, 317.99926757813) -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. function Open ( pla ) if getElementType ( pla ) == "player" then if isStaff(pla) then moveObject (cone1, 300, -1679.0999755859, -2884.1000976563, 50) moveObject (cone2, 300, -1681.5, -2881.8000488281, 50) moveObject (cone3, 300, -1684.1999511719, -2879.3999023438, 50) moveObject (cone4, 300, -1686.8000488281, -2877, 50) moveObject (gate1, 2500, -1674.4000244141, -2888.8999023438, 54) -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. end end end addEventHandler ( "onColShapeHit", col, Open) function Close ( pla ) if getElementType ( pla ) == "player" then if isStaff(pla) then moveObject (cone1, 300, -1679.099609375, -2884.099609375, 51.099998474121) moveObject (cone2, 300, -1681.5, -2881.7998046875, 51.099998474121) moveObject (cone3, 300, -1684.19921875, -2879.3994140625, 51.099998474121) moveObject (cone4, 300, -1686.7998046875, -2877, 51.099998474121) moveObject (gate1, 2500, -1683, -2881.19921875, 54) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. end end end addEventHandler ( "onColShapeLeave", col, Close ) function isStaff(player) -- I meant here to replace "pla" with "player". for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then return true end break end return false end
  5. Weird, I never heard or had such bug, are you sure is not there? maybe isn't started?
  6. Castillo

    staff

    Post what did you do, maybe you didn't get me right.
  7. Check the ACL "Moderator", I guess it's all set to "true".
  8. Castillo

    help

    I would say that the text is too long, I tried it too and it didn't work, I tried it with a smaller text and it worked.
  9. Castillo

    staff

    You changed the player argument at "isStaff" with "pla", replace it again with "player".
  10. Castillo

    staff

    Oh, now I get it, use this: function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) if isStaff(player) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementData(thePlayer, "jailSkin", getElementModel ( thePlayer )) setElementModel ( thePlayer, 22 ) setElementPosition ( thePlayer, 52, 2483, 21 ) takeAllWeapons ( getRootElement() ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (getPlayerName(thePlayer).." has been jailed", getRootElement(), 255, 0, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isStaff(player) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementModel ( thePlayer, tonumber(getElementData(thePlayer,"jailSkin"))) setElementData ( thePlayer, "isJailed", false ) outputChatBox (getPlayerName(thePlayer).." has been unjailed. Be good now, "..getPlayerName(thePlayer), getRootElement(), 0, 255, 0, true ) else outputChatBox ("You cannot unjail yourself!", player, 255, 0, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setPedRotation (ped1inside, 180) function respawn() local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) setTimer(createPed, 60000, 1, 71, x,y,z,rz) if isElement(ped1inside) then destroyElement(ped1inside) end end addEventHandler("onPedWasted",ped1inside,respawn) function visit (player) setElementPosition (player, 71, 2499, 17 ) end addCommandHandler("visitjail", visit) function isStaff(player) for index, group in ipairs({"Admin", "SuperModerator", "Moderator"}) do if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( group ) ) then return true end break end return false end
  11. Castillo

    help

    function connect() outputChatBox("Hello, i am your assistant. You can ask me questions and i will perform tasks. You can even ask for a car, or weapon. You can also talk to me! Go ahead, have fun!", source, 0, 255, 0) end addEventHandler("onPlayerJoin", getRootElement(), connect) "onPlayerConnect" event is when a player CONNECTS to the server, not when he joins.
  12. Si, o tambien podrias hacer asi: exports["Policias"]:TerminaPoli(Jugador)
  13. Castillo

    How to..

    Why not use the trailer functions instead? function checkAttachedElement(player) local veh = getPedOccupiedVehicle(player) if veh then local trailer = getVehicleTowedByVehicle(veh) if getElementModel(veh) == 515 and trailer then outputChatBox(tostring(getElementModel(trailer)), player) end end end addCommandHandler("check",checkAttachedElement)
  14. Castillo

    Help

    function sendMessage2( messageclean, messageType) if (string.find(messageclean, "i") and string.find(messageclean, "love") and string.find(messageclean, "bot")) then outputChatBox("i love you too!", source, 191, 62, 255) elseif (string.find(messageclean, "i") and string.find(messageclean, "hate") and string.find(messageclean, "bot")) then outputChatBox("Ill note that", source, 191, 62, 255) elseif (string.find(messageclean, "hi") and string.find(messageclean, "bot")) then outputChatBox("Hello", source, 191, 62, 255) elseif (string.find(messageclean, "how") and string.find(messageclean, "are") and string.find(messageclean, "bot")) then outputChatBox("I'm doing great", source, 191, 62, 255) elseif (string.find(messageclean, "i") and string.find(messageclean, "a") and string.find(messageclean, "infernus")) then executeCommandHandler("sv", source, "infernus") end end addEventHandler("onPlayerChat",root,sendMessage2)
  15. exports.scoreboard:scoreboardAddColumn("ACL") function setACL(player) local admin = "Admin" local supermoderator = "SuperModerator" local moderator = "Moderator" local everyone = "Visitor" local console = "HeadAdmin" if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setElementData ( player, "ACL", admin ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "SuperModerator" ) ) then setElementData ( player, "ACL", supermoderator ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Moderator" ) ) then setElementData ( player, "ACL", moderator ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Console" ) ) then setElementData ( player, "ACL", console ) elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Everyone" ) ) then setElementData ( player, "ACL", everyone ) end end function timer() setTimer( setACL, 1000, 1, source ) end addEventHandler("onPlayerLogin", getRootElement(), timer) addEventHandler("onPlayerJoin", getRootElement(), timer) Never use a existing function name.
  16. Castillo

    staff

    I understand by "Staff" you mean a ACL group called "Staff". function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Staff" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementData(thePlayer, "jailSkin", getElementModel ( thePlayer )) setElementModel ( thePlayer, 22 ) setElementPosition ( thePlayer, 52, 2483, 21 ) takeAllWeapons ( getRootElement() ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (getPlayerName(thePlayer).." has been jailed", getRootElement(), 255, 0, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Staff" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementModel ( thePlayer, tonumber(getElementData(thePlayer,"jailSkin"))) setElementData ( thePlayer, "isJailed", false ) outputChatBox (getPlayerName(thePlayer).." has been unjailed. Be good now, "..getPlayerName(thePlayer), getRootElement(), 0, 255, 0, true ) else outputChatBox ("You cannot unjail yourself!", player, 255, 0, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setPedRotation (ped1inside, 180) function respawn() local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) setTimer(createPed, 60000, 1, 71, x,y,z,rz) if isElement(ped1inside) then destroyElement(ped1inside) end end addEventHandler("onPedWasted",ped1inside,respawn) function visit (player) setElementPosition (player, 71, 2499, 17 ) end addCommandHandler("visitjail", visit)
  17. It's a idea never seen, keep up the good work .
  18. function TerminaPoli(player) local civil_team = createTeam("Civil", 255, 255, 0) local team = getTeamFromName ( "Civil" ) takeWeapon ( player, 3 ) setPedArmor ( player, 0 ) Informa() team2() Tuteam1() local vehiculos = { [523] = true , [596] = true , [597] = true, [598] = true , [599] = true } --Puedes agregar mas modelos a esta tabla if isPedInVehicle(player) then local veh = getPedOccupiedVehicle ( player ) if getVehicleOccupant( veh ,0 ) == player then --if getElementModel ( veh ) == 596 or getElementModel ( veh ) == 598 or getElementModel ( veh ) == 597 or getElementModel ( veh ) == 599 or getElementModel ( veh ) == 523 then if vehiculos[getElementModel ( veh )] then destroyElement( veh ) end end end end addEventHandler( "terminapoli", getRootElement(), TerminaPoli ) function Informa() local account = getPlayerAccount(source) local accountName = getAccountName(account) money = dbQuery(link, "SELECT usuario FROM skin WHERE usuario='".. accountName .."'") local queryResult = dbPoll ( money , -1 ) if queryResult[1]['usuario'] == accountName then money1 = dbQuery(link, "SELECT skinID FROM skin WHERE usuario='".. accountName .."'") local queryResult1 = dbPoll ( money1 , -1 ) local SkinFinal = queryResult1[1]['skinID'] setPedSkin(source,SkinFinal) end end Cuando uses el evento "terminapoli" vas a tener que pasar el jugador, y al usar la funcion exportada tambien.
  19. Castillo

    help

    I supposed you was using it with onPlayerChat event. function sendMessage2( messageclean, messageType) if (string.find(messageclean, "i") and string.find(messageclean, "love") and string.find(messageclean, "bot")) then outputChatBox("i love you too!", source, 191, 62, 255) end end addEventHandler("onPlayerChat",root,sendMessage2)
  20. Castillo

    help

    function sendMessage2( messageclean, messageType) if string.find(messageclean, "i") and string.find(messageclean, "love") and string.find(messageclean, "bot") then outputChatBox("i love you too!", source, 191, 62, 255) end end
  21. Castillo

    help

    Show us the full script.
×
×
  • Create New...