Jump to content

danifer

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by danifer

  1. local healthPickup = createPickup ( x, y , z, pickupType, amount, respawn ) 
    

    pickup is created fine and when I walk over it , it dissappears and reappears after given respawn time. Like it should. And my health increases of course.

    when I hook onPickupUse or onPickupHit (not both at the same time) I run into problems. Tried both.

    In the event handler function I sent a msg to the chatbox telling what the user picked up, but I always get two messages like the event was triggered

    twice. How is this possible ? Since it dissappears , you shouldn't be able to pick a pickup more than once , right? Until it respawns.

    Another thing, first I sat pickupType to integer 0 since I first read this in the wiki for the function createPickup which said an integer value, then I read the wiki for the element Pickup and what I gathered there was

    that it was supposed to be set to the string "health".

    only difference between those were

    first scenario wrote out this...twice: (using pickupType = "health")

    "you picked up 100 health "

    second scenario wrote out (using pickupType = 0):

    "you picked up 100 health" and then "you picked up 0 melee"

    What am I doing wrong?

    Thanks!

  2. for instance you could create commands with addCommandHandler() that only accepted special commands from only a certain account, using the getPlayerAccount(), that is you, the admin.....maybe?

    I haven't looked into this so I don't if this is the best way to go, but it would work.

  3. sounds like notepad++ can intererpt single linebreaks (lf) and windows linebreaks (crlf) but notepad can only do windows.

    what Ive read \n should translate to the systems respective linebreak sequence..but it looks like its not.

    try this instead

    \r\n 
    

    or

    \n\r 
    

    or perhaps

    \x0D\x0A 
    

  4. Try this:

    function logPlayerPos( player ) 
         
        local x,y,z = getElementPosition( player )   
        outputServerLog ( "Position (x,y,z) => " .. x .. " , " .. y .. " , " .. z)   
        outputChatBox ( "Your Position (x,y,z) => " .. x .. " , " .. y .. " , " .. z, player) 
         
    end 
      
    addCommandHandler ( "savepos", logPlayerPos) 
    

    This will log your current position to \server\mods\deathmatch\logs\server.log

  5. I have created a health pickup with a script. I can see the pickup at specified location, but when I take it I gain no health.

    Do I have to handle the onPickupHit / onPickupUse and change the health explicitly ? Or is it a bug ?

×
×
  • Create New...