Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Question...

    Ofcourse it will, why not ? You either got me wrong or just want to increase the post count. His first post was: "How would I disable the "logout" command?" In my first reply I gave him the code to reconnect every time someone logs out (not just via /logout command), and then I supposed he wanted just for the /logout command, so I replied again. Did you get me now?
  2. Castillo

    Question...

    Oh, btw, this will work every time they try to logout, but also when logout is not coming from /logout command. If you want it only for /logout command, try this: addEventHandler("onPlayerCommand",root, function (cmd) if (tostring(cmd) == "logout") then redirectPlayer(source, "serverIP", "serverPort") end end)
  3. Castillo

    Question...

    addEventHandler("onPlayerLogout",root, function () redirectPlayer(source, "serverIP", "serverPort") end)
  4. I've tested that, and it doesn't.
  5. Castillo

    litel help

    for index=1, 22 do outputChatBox(tostring(index)) end
  6. Well, then you can't even talk about it, because you did it too.
  7. function myHealth() exports.scoreboard:scoreboardAddColumn ( "Health" ) local playerHealth = getElementHealth ( getLocalPlayer() ) setElementData ( getLocalPlayer ( ), "Health", math.floor(playerHealth)) end addEventHandler ( "onClientResourceStart", resourceRoot, myHealth)
  8. We all fail at something when learning, but that's how some people learn to fix their errors.
  9. Maybe is adding the event handler too soon?
  10. CapY, using public resources is not called "Steal", many people learns from them.
  11. Cool, I've tested it, died twice and my max score was 750 , I suck at this I think .
  12. Nice work Slothman, I'll check it out as soon as possible.
  13. setCameraMatrix arguments are: Required Arguments thePlayer: The player whose camera is to be changed. -- Not required client side. positionX: The x coordinate of the camera's position. positionY: The y coordinate of the camera's position. positionZ: The z coordinate of the camera's position. Optional Arguments lookAtX: The x coordinate of the point the camera faces. lookAtY: The y coordinate of the point the camera faces. lookAtZ: The z coordinate of the point the camera faces. roll: The camera roll angle, -180 to 180. A value of 0 means the camera sits straight, positive values will turn it counter-clockwise and negative values will turn it clockwise. -180 or 180 means the camera is upside down. fov: the field of view angle, 0 to 180. The higher this value is, the more you will be able to see what is to your sides.
  14. I have no idea, it worked fine in my server.
  15. That is not required, the event handler is binded to that button now.
  16. You shouldn't post if you don't know anything about it.
  17. Castillo

    Ped

    Uh, my bad, I was destroying it before create new, copy my code again.
  18. --This function is executed when the button is clicked - it warps the local player. local function onTeleportButtonClicked() local localVehicle = getPedOccupiedVehicle(localPlayer) if localVehicle then if getVehicleController(localVehicle) == localPlayer then --IF the player is driving a vehicle, warp the vehicle. setElementPosition(localVehicle, 1523.9138183594, 1527.1204833984, 10.2602405548) end else setElementPosition(localPlayer, 1523.9138183594, 1527.1204833984, 10.2602405548) end end addEventHandler("onClientGUIClick", GUIEditor_Button[1], onTeleportButtonClicked, false)
  19. Castillo

    Ped

    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 ( "Admin" ) ) 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 (name.." 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 ( "Admin" ) ) 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 (name.." has been unjailed. Be good now, "..name, 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)
  20. Oh, well, I didn't know that .
  21. Castillo

    Ped

    onClientPedWasted is client side. 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 ( "Admin" ) ) 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 (name.." 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 ( "Admin" ) ) 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 (name.." has been unjailed. Be good now, "..name, 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) end addEventHandler("onPedWasted",ped1inside,respawn)
  22. Doesn't setElementHealth repair that too?
  23. What do you mean? I don't understand.
×
×
  • Create New...