Git Product home page Git Product logo

gettime-funcoes's Introduction

Include GettimeFuncoes SA:MP

Este é um include que contém uma função para abreviar o gettime e o getdate. Leia as categorias abaixo para se manter informado.

English > README.


Como instalar?

Você deve fazer o download do include. Depois de tê-lo feito, você deverá colocar o include na pasta (pawno > include). Após ter feito isso, abra o arquivo pwn do seu Gamemode e coloque o seguinte código abaixo dos seus outros includes:

#include <GettimeFuncoes>

Qual é a diferença?

Aqui estão dois comandos, e você poderá observar a diferença ao utilizar ou não o meu include.

Comando sem a include:

CMD:dataehora(playerid)
{
    new string[100], dia, mes, ano, hora, minuto, segundo;
    //
    getdate(ano, mes, dia);
    gettime(hora, minuto, segundo);
    //
    format(string, sizeof string, "Data e Tempo: %02d/%02d/%04d as %02d:%02d:%02d.", dia, mes, ano, hora, minuto, segundo);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

Comando com a include:

CMD:dataehora(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Data e Tempo: %s.", Gettime_Funcao(DATA_E_TEMPO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

Como funciona?

Não há nenhum segredo ao utilizar a função Gettime_Funcao. O formato dependerá de cada definição que está logo abaixo; inclusive, cada definição terá um exemplo para melhor entendimento.

Note

DATA_E_TEMPO //0

APENAS_A_DATA //1

APENAS_O_TEMPO //2

DATA_SEM_SEGUNDOS //3

DATA_SEM_ANO //4

TEMPO_SEM_SEGUNDOS //5

APENAS_O_ANO //6

APENAS_O_MES //7

APENAS_O_DIA //8

APENAS_A_HORA //9

APENAS_O_MINUTO //10

APENAS_O_SEGUNDO //11


  • Ex: DATA_E_TEMPO
CMD:dataehora(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Data e Tempo: %s.", Gettime_Funcao(DATA_E_TEMPO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_A_DATA
CMD:data(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Data: %s.", Gettime_Funcao(APENAS_A_DATA));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_O_TEMPO
CMD:tempo(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Tempo: %s.", Gettime_Funcao(APENAS_O_TEMPO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: DATA_SEM_SEGUNDOS
CMD:data(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Data: %s.", Gettime_Funcao(DATA_SEM_SEGUNDOS));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: DATA_SEM_ANO
CMD:data(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Data: %s.", Gettime_Funcao(DATA_SEM_ANO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: TEMPO_SEM_SEGUNDOS
CMD:tempo(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Tempo: %s.", Gettime_Funcao(TEMPO_SEM_SEGUNDOS));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_O_ANO
CMD:ano(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Ano: %s.", Gettime_Funcao(APENAS_O_ANO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_O_MES
CMD:mes(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Mes: %s.", Gettime_Funcao(APENAS_O_MES));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_O_DIA
CMD:dia(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Dia: %s.", Gettime_Funcao(APENAS_O_DIA));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_A_HORA
CMD:hora(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Hora: %s.", Gettime_Funcao(APENAS_A_HORA));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_O_MINUTO
CMD:minuto(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Minuto: %s.", Gettime_Funcao(APENAS_O_MINUTO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

  • Ex: APENAS_O_SEGUNDO
CMD:segundo(playerid)
{
    new string[100];
    //
    format(string, sizeof string, "Segundo: %s.", Gettime_Funcao(APENAS_O_SEGUNDO));
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    //
    return true;
}

Se preferir não definir a callback Gettime_Funcao com as definições mencionadas anteriormente, você pode atribuir valores específicos a elas. Basta verificar no Note o número correspondente a cada definição.


Informações de contato

Instagram: ocalasans
YouTube: Calasans
Discord: ocalasans
Comunidade: SA:MP Programming Community©

gettime-funcoes's People

Contributors

ocalasans avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.