Jump to content

Mqtyx

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Mqtyx

  1. Mqtyx

    commands time

    As soon as the player types the command, you can store the tick count at this time and then based on that, you can check later whether the player used the command before the last 30 minutes. An example: local antiSpam = { } function someCommandHandler(plr) local lastCheck = antiSpam[plr] local currentTick = getTickCount() if (lastCheck and (currentTick - lastCheck) < (30 * 60000)) then -- Unless lastCheck is nil, get the current tick and subtract from it the last time the player used the command then check whether the result is smaller than 30 minutes and if so, return return false end antiSpam[plr] = currentTick -- Updates the antiSpam table with the new info -- Do whatever you want end addCommandHandler("somecommand", someCommandHandler)
  2. That'd be really inefficient calling this function over and over yet, that ain't possible I guess. A really efficient way that just come in my mind is that you initialize the account state when the player joins the server and store it in a global variable client side. An example: accountState = nil function theClientSideEventThatInitializesLoginPanel(accState) accountState = accState end addEvent("theClientSideEventThatInitializesLoginPanel", true) addEventHandler("theClientSideEventThatInitializesLoginPanel", resourceRoot, theClientSideEventThatInitializesLoginPanel) function render() -- Your rendering function -- Here you can use the accountState variable however you like. end
  3. An example of what I mean might help you out: Server side: function whateverEventYouAreUsing() -- The event that initializes login panel server side triggerClientEvent(source, "theClientSideEventThatInitializesLoginPanel", resourceRoot, getPlayerAccountState(source)) end Client side: function theClientSideEventThatInitializesLoginPanel(accountState) if (accountState == "haveAccount") then -- Do whatever you want when the player has an account else -- Do whatever you want when the player doesn't have an account end end addEvent("theClientSideEventThatInitializesLoginPanel", true) addEventHandler("theClientSideEventThatInitializesLoginPanel", resourceRoot, theClientSideEventThatInitializesLoginPanel)
  4. Use triggerClientEvent in order to send the data you want to be sent to client side. triggerClientEvent
  5. Add isPlayerMuted check in the function that handles F1 to check whether the player is muted or not.
×
×
  • Create New...