[SCRIPT] Zcript (Admin tools)

A big new update is now available, introducing biomes, caves and much more!
Latest hotfix: 0.7.0.3 (2024-02-21)
  • Well, I'm afraid I can't do anything. The only in game build function I can use to get a player position is getPlayerPosition, and I use it calling a "player object", I guess it's returning the position's vector of the player, the one stored on the database ... I hope Red will find a solution soon :)


    And BTW : I'm not sure there's build-in function to restart a server. To be honest, I don't know much of the functions usable for scripting, the most I know are from Red himself. But, IMAO, adding in-game a function to restart the server could be dangerous, or had to be well maid ^^

  • Do you only want to read the vector coordinates itself or what were you trying?


    If so, have a look at this
    [lua]
    local position = event.player:getPlayerPosition()


    event.player:sendTextMessage("X: " .. position.x .. " Y: " .. position.y .. " Z: " .. position.z)
    [/lua]

  • There's actually a function in Zcript called /pos doing the exact same thing as what you're saying here :D


    For the tp, I'm doing like so (this is pseudo code, I don't remember the exact syntax I used ) :


    admin:setPlaterPosition(target:getPlayerPosition)


    with both admin and target player objects.


    The thing is that right now, the setPlayerPosition is changing the coordinate of a player on the database stored on the server, BUT, this change nothing on the client side ! So, for the server you actually changed position, but you won't see it in game since it doesn't really physically moves you.
    Red told me it probably came from the ingame build function that was bugged :)

  • Nevermind. I totally misunderstood your previous post X/


    Has anyone ever tried that in multiplayer, so when someone else is watching you teleporting, does your position change for him?

  • Is there anyone willing to give me some advice/help about SQL ? I'm trying to work on group management, and I'm working with some DB, but as I am quite a n00b on SQL, I could really use some export's help :D Thanks !

  • Game update, and Zcript update too ! I've re-organized the code for easier understanding, and changed some commands :


    Here's a quick changelog !

    • The TP command now works fine !!!
    • /tp can now be used using a name or an ID. This command teleport the admin to a player position
    • /tp2 can now be used using a name or an ID. This command teleport the target (the playerID or name) to the admin
    • /help now list sub help categories
    • /ahelp list all functions only usable by admin
    • /zhelp list all functions only usable by regular player


    The /help and sub help became necessary due to the number of commands that will soon be added (group management system) which will be listed under /ghelp. This will come really really soon !!! Stay tuned :D


    I've edited my first post with new link. Hope you'll enjoy it :D

  • Quick update, I've found a really stupid bug on the /tp and /tp2 functiuns (some stupid stuff about local variables ...), I've retested evrything, I've no error when running all of the commands. However, as I'am trying it alone, I dunno if it's working well (I mean really TP you !), need feedback dudes ! :D

  • If you are talking about when TPing to another player it spawns you up in the air at one of the players previous locations yes I have fallen victim to the bug to, if you have updated the script again me and my team are willing to update it again and retest and give you feedback.

  • Ha ha ha ha Wunderbar ! I guess that it must be because the server is, in some kind of way, considering that the player is reconecting when he eats ... thats really strange and thanks for reporting me this bug, I'll disable this message until I found from where it comes.


    Stealth : you mean, the fact that you are tping to a position where theres nobody ?
    That's also strange and its a bug already known by the dev. Dont know if its still bugged ! :/

  • I'll less update the Media Fire link, if you want to have the latest version (at your own risk, however this would help me a lot) you can find it on my Git Hub (Master branch, be carrefull). A lot of new features can't be fully tested by myself alone, so I need feedback on the ongoing work !


    Thanks :)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!