[FilterScript] DS - Record Players
#1

Olб!
Hoje trago um sistema que criei.
Record de players .
Eu so tinha visto isso na board inglesa se nгo me engano .
De vista parece um bicho de 7 cabeзas mas e facin Menos de 10 minutos eu fiz.
E muito util para marcar recordes de seu servidor.

Vamos lб:

Код:
/setrecord [quantia]   - com esse cmd seta o record para quanto tu quizer :)
/resetrecord   - Reseta o record
Para os troxa que irгo dizer que nгo testei Ibagen abaixo



Code
pawn Код:
#include                  a_samp
#include                  DOF2
#include                  zcmd
#include                  sscanf2

#define                   SAVERECORD                                "Record.ini"

new   Record,
      PlayersOn,
      Don[100];
public OnFilterScriptInit()
{
    if(!DOF2_FileExists(SAVERECORD))
    DOF2_CreateFile(SAVERECORD);
    DOF2_SetInt(SAVERECORD, "Players", 0);
    Record = DOF2_GetInt(SAVERECORD, "Players");
    return 1;
}
public OnFilterScriptExit()
{
    if(!DOF2_FileExists(SAVERECORD))
    DOF2_SetInt(SAVERECORD, "Players", Record);
    DOF2_SaveFile();
    DOF2_Exit();
    return 1;
}
public OnPlayerConnect(playerid)
{
    PlayersOn++;
    if(PlayersOn > Record)
    {
         Record = PlayersOn;

         format(Don,sizeof(Don),"[Aviso]Novo record de players : %d Players ON", Record);
         SendClientMessageToAll(-1, Don);

         if(!DOF2_FileExists(SAVERECORD))
         DOF2_SetInt(SAVERECORD, "Players", Record);
         DOF2_SaveFile();

         return true;
    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    PlayersOn--;
    return 1;
}
command(setrecord, playerid, params[])
{
    new NR;
    if(!IsPlayerAdmin(playerid))return true;
    if(sscanf(params,"d", NR))return SendClientMessage(playerid, -1, "[Uso] /setrecord [quantia]");
   
    format(Don,sizeof(Don),"[Aviso]Novo record de players : %d Players [Setado pelo Admin]", params);
    SendClientMessageToAll(-1, Don);

    Record = NR;
   
    if(!DOF2_FileExists(SAVERECORD))
    DOF2_SetInt(SAVERECORD, "Players", Record);
    DOF2_SaveFile();
    return true;
}
command(resetrecord, playerid, params[])
{
    if(!IsPlayerAdmin(playerid))return true;
    SendClientMessageToAll(-1, "[Aviso]Admin resetou o record de players do servidor.");
    if(!DOF2_FileExists(SAVERECORD))
    DOF2_SetInt(SAVERECORD, "Players", 0);
    DOF2_SaveFile();
    return true;
}
Creditos a DonSpeed

Nгo remova os creditos


Gostou Comente .
Nгo gostou Faзa criatica contrutiva!

Reply


Messages In This Thread
DS - Record Players - by Don_Speed - 28.01.2013, 13:50
Re: DS - Record Players - by EditPawn - 28.01.2013, 14:00
Respuesta: DS - Record Players - by [NVC]iTrevaS - 28.01.2013, 14:01
Re: DS - Record Players - by paulor - 28.01.2013, 14:33
Re: DS - Record Players - by Maklister - 28.01.2013, 14:38
Re: DS - Record Players - by Schocc - 28.01.2013, 15:20
Re: DS - Record Players - by ViniBorn - 28.01.2013, 15:26
Re: DS - Record Players - by Maklister - 28.01.2013, 16:36
Re: DS - Record Players - by Don_Speed - 28.01.2013, 16:36
Re: DS - Record Players - by Schocc - 28.01.2013, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)