Posts by Zabka

    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 ) :


    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 :)

    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 ^^


    First of all, you seem to say that the TP function does work on your server ? I haven't tested the script for a long time (too much work right now :/) but as far as I know, the in-game function I'm using in the script (setPlayerPosition(x,y,z) was bugged at the time I wrote the script. Red told me it would be soon fixed, but I'm not sure it have been yet ? You can confirm me that it is now working ?

    What did you mean by copy of a player ? I don't get it ? There's theorically only one player associated with a name OR/AND an ID, and so only one set of coordinates for each player ? I hardly see how the DB could have 2 entrance for the same given player ? :/

    I'm not sure I could to it with build-in function, but please, feel free to speak with your server's owner, I'd be glad to help you setting up something to deal with this :) (I'm working on S&N Administration ;) )


    Salut ! :D

    Merci ça fait plaisir à entendre, je suis content que le script fonctionne bien et te soit utile ! j'ai pas prévu d'arrêter pour le moment :D mais en semaine je passe tout mon temps à coder sur un PC au boulot, du coup le soir j'ai pas spécialement envie de coder, faudra attendre le week end pour des mises à jours :)

    So the slot on the server isn't released when the player is kicked ?

    Then you can use the ban function for 1 minute ?! See in Zcript the ban function. It's using a DB, and there's a lot of function involved so I won't copy paste them here ^^

    I don't get it sorry ^^ I didn't speak a word of german !

    This is a kick function, it will kick the player, but he can still come back, is this the problem ?

    I've add a kick function that I haven't test yet since I can't do it alone, however when I try to kick myself, the game is returning me an error, but there's no error on the dedicated console, so I guess this should work fine :D

    Well, here's a kick function that should be working, however, I can't test alone, since evrytime I try to kick myself, the game throw my an error, however, there's no error on the server console, so I guess this works !

    The command below is called on event, when a player type in the chat, then exploded in a table of String I acces with cmd[int].

    if cmd[1] == "/kick" then
    -- Checking if admin :
    if not event.player:isAdmin() then return msgAccessDenied(event.player) end
    -- Checking if there's a player, don't check for reason
    if not cmd[2] then return msgInvalidUsage(event.player) end
    -- Call the kick function
    local target = server:findPlayerByID(cmd[2]);
    kickPlayer(event.player, target, cmd[3]);

    function kickPlayer(kicker, target, reason)
    local tName = target:getPlayerName()
    kicker:sendTextMessage("You kicked "..tName.." !")

    Hope this would work ;)

    It is also possible to set player attributes directly (you use a key [has to be a string] and a value [can be any kind of object]):

    [lua]event.player:setAttribute("Job", "Worker");
    event.player:setAttribute("Money", 420);

    local job = event.player:getAttribute("Job"); -- returns "Worker" as string
    local money = event.player:getAttribute("Money"); -- returns 420 as integer[/lua]

    Are thoose attributes stocked somewhere ? Are they persistant ?

    I'm not sure, but what is playeronline in your code ? Is this an array ? A function ? What is it returning ?

    If playeronline is an array, returning I'm assuming a Player Object, you should try something like :

    [lua]function SendMessageToAdmin(msg)
    for i = 0, MaxPlayerSlots do
    actualPlayer = playeronline[i];
    if actualPlayer:isAdmin() then

    Hi dudes, thanks to Google Traduction, I've read your conversation ^^

    The setPlayerPosition(x,y,z) is actually an already implemented method in the game, BUT right now, when you call this function, the position of the player (which is stocked on a database on the server side) is correctly changed BUT there's nothing done on the actual player screen. I've told Red51 about it, and he said to me that this problem would be fixed in the next game update !

    Cheers !

    Hallo Jungs, dank Google Traduction, habe ich das Gespräch zu lesen ^^

    Die setPlayerPosition (x, y, z) ist eigentlich eine bereits implementierte Verfahren im Spiel, aber im Moment, wenn Sie diese Funktion aufrufen, wird die Position des Spielers (der auf einer Datenbank auf der Serverseite bestückt wird) korrekt geändert ABER es gibt nichts auf dem tatsächlichen Player-Bildschirm durchgeführt. Ich habe Red51 davon erzählt, und er sagte zu mir, dass dieses Problem in der nächsten Spielupdate behoben werden!