Jump to content

Question


Dimos7

Recommended Posts

Posted

Then destroy it when you quit and spawn when log in. It's simple. These are the functions you're gonna need:

destroyElement 
createVehicle 
  

Events:

onPlayerQuit 
onPlayerLogin 
  

  • 9 months later...
Posted

How i can get in client side the time a player play like this?

  
function playTime() 
    local time = getRealTime() 
    local hours = time.hour 
   local minutes = time.minute 
end 

Posted

onClientResourceStart save the time with getTickCount()

Then just use getTickCount()-savedtime to get the time in ms the player is playing.

Posted

responsibleElement: The element that is responsible for banning the IP/username/serial. This can be a player or the root (getRootElement()).

Posted (edited)

I create a script that jailed a player is offline and put a timer and i want to know if the the timer iwll killed if player is off?

function oflinejailPlayer(thePlayer, name, minutes, , reason , ..., _) 
   local query = dbQuery(connection, "SELECT * FROM accounts WHERE name=?", name) 
   local result, num_affected_rows = dbPoll(query, -1) 
   local adminlevel = getElementData(thePlayer, "adminlevel") 
   local minutes = tonumber(minutes) 
   local reason = table.concat({...}, "") 
   if num_affected_rows == 1 then 
      if adminlevel >= 1 then 
         if minutes >= 1 and minutes <= 60 then 
            if reason ~= "" then 
               target = getPlayerFromName(name) 
               dbExec(connection, "UPATE punishments SET type=? and name=? and serial=? and by=? and reason=? and starttime=? and finishtime=?", "jail", name, getPlayerSerial(target), getPlayerName(thePlayer), reason, getRealTime().timestamp, getRealTime().timestamp + minutes * 60) 
              jailPlayer(thePlayer, target, minutes, reason ) 
            else 
               outputChatBox("Use /ojail [name] [minutes] [reason]", thePlayer, 255, 0, 0) 
               return false 
            end 
        else 
           outputChatBox("Jail time is min 1 minute and max 60 minutes", thePlayer, 255, 0, 0) 
           return false 
        end 
    else 
       outputChatBox("You aren't a admin.", thePlayer, 255, 0, 0) 
       return false 
    end 
    else 
       outputChatBox("Name not found!", thePlayer, 255, 0, 0) 
       return false 
    end 
end 
addCommandHandler("ojail", oflinejailPlayer) 

Edited by Guest

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...