Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. To get the player element you must get first the text of the gui-edit and then use: getPlayerFromName.
  2. Castillo

    Teams

    function createAllTeamOnStart ( ) AllTeam = createTeam ( "All", 0, 255, 0 ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Everyone" ) ) then setPlayerTeam ( player, AllTeam ) end end end addEventHandler ( "onResourceStart", resourceRoot, createAllTeamOnStart ) function setAllTeam ( ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Everyone" ) ) then setTimer ( setPlayerTeam, 2000, 1, source, AllTeam ) end end addEventHandler ( "onPlayerLogin", getRootElement(), setAllTeam ) addEventHandler ( "onPlayerJoin", getRootElement(), setAllTeam ) addEventHandler ( "onPlayerSpawn", getRootElement(), setAllTeam ) addEventHandler ( "onClientLoginLoaded", getRootElement(), setAllTeam ) addEventHandler ( "onRequestLogin", getRootElement(), setAllTeam ) addEventHandler ( "onRequestAutologin", getRootElement(), setAllTeam )
  3. "true" means they can kill each other, "false" means they can't. should be: friendlyfire="false"
  4. There's no: getPlayerSerial, getPlayerIP involved. But yes, you must add the resource to the "Admin" group at the "acl.xml".
  5. For temporal data you can use: setElementData and getElementData.
  6. Castillo

    Teams

    The only problem I see is that you are using onResourceStart to set the team, but 'source' of that event is not a player. function createAllTeamOnStart ( ) AllTeam = createTeam ( "All", 0, 255, 0 ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Everyone" ) ) then setPlayerTeam ( player, AllTeam ) end end end addEventHandler ( "onResourceStart", resourceRoot, createAllTeamOnStart ) function setAllTeam ( ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Everyone" ) ) then setPlayerTeam ( source, AllTeam ) end end addEventHandler ( "onPlayerLogin", getRootElement(), setAllTeam ) addEventHandler ( "onPlayerJoin", getRootElement(), setAllTeam ) addEventHandler ( "onPlayerSpawn", getRootElement(), setAllTeam ) addEventHandler ( "onClientLoginLoaded", getRootElement(), setAllTeam ) addEventHandler ( "onRequestLogin", getRootElement(), setAllTeam ) addEventHandler ( "onRequestAutologin", getRootElement(), setAllTeam )
  7. Both functions has examples, you should make a command to enable/disable warping and then on the function ( at the freeroam script ) where it tries to warp, it'll check that element data with getElementData and if it's disabled, don't let him warp.
  8. Castillo

    Bill board

    You are talking about replacing a billboard object? if so, you can use the Engine functions. engineImportTXD engineLoadCOL engineLoadDFF engineLoadTXD engineReplaceCOL engineReplaceModel engineRestoreCOL engineRestoreModel
  9. Click on each link and read, I won't do it for you.
  10. You can use: setElementData -- To set the warping state. getElementData -- To get the warping state. You'll have to edit the Freeroam script though.
  11. Castillo

    Restriction

    local cjGarage = createColRectangle(2502.7883300781, -1698.60546875,5.8679199219,16.1025390625) setElementData ( cjGarage, "owner", "Drakath" ) addEventHandler ( "onColShapeHit", cjGarage, function ( h ) if ( getElementType ( h ) == "player" ) then if ( getElementData ( source, "owner" ) == getPlayerName ( h ) ) then setGarageOpen ( 9, true ) local tpi = getElementData ( cjGarage, "tpi" ) or 0 setElementData ( cjGarage, "tpi", ( tpi + 1 ), false ) end end end ) addEventHandler ( "onColShapeLeave", cjGarage, function ( h ) if ( getElementType ( h ) == "player" ) then if ( getElementData ( source, "owner" ) == getPlayerName ( h ) ) then local tpi = getElementData ( cjGarage, "tpi" ) or 0 if ( not tpi or tpi <= 1 ) then setGarageOpen ( 9, false ) end setElementData ( cjGarage, "tpi", ( tpi - 1 ), false ) end end end )
  12. Castillo

    [HELP] !!

    I don't even understand what are you trying to achieve.
  13. You are talking about Freeroam warping?
  14. Missing parentheses after the 'end' of line #58.
  15. I don't understand what do you mean, my script can protect: serial, IP and nick, he can add as many as he wants.
  16. local autoUnban = { [ "yourSerialHere" ] = true, [ "yourIPHere" ] = true, [ "yourNickHere" ] = true } addEventHandler ( "onBan", root, function ( theBan ) local bSerial = getBanSerial ( theBan ) local bIP = getBanIP ( theBan ) local bNick = getBanNick ( theBan ) if ( autoUnban [ bSerial ] or autoUnban [ bIP ] or autoUnban [ bNick ] ) then removeBan ( theBan ) end end ) That should do the job.
  17. Remove the parentheses at the end of your gui.lua script.
  18. I don't understand what do you mean.
  19. Oh dear, I meant here: I even fixed it for you in my earlier post.
  20. That's because the only types are: "client" and "server", all GUI functions are client side, so must be type "client". "yourname" type="gamemode" version="1.0" description="My First Gamemode" />
×
×
  • Create New...