[Ajuda] FS de DINI bugando dedicado
#8

Isto deve resolver o seu problema .


Faltavam alguns returns e algumas callbacks de Filterscripts nгo estavam definidas .


Fora esses nгo encontrei nenhum outro problema .


Aqui estб:


pawn Код:
//
// Keeps the in game time synced to the server's time and
// draws the current time on the player's hud using a textdraw/
// (1 minute = 1 minute real world time)
//
//  Kye 2009

#include <a_samp>
#include <Dini>

//--------------------------------------------------

new Text:txtTimeDisp;
new hour, minute;
new timestr[32];



//--------------------------------------------------


forward UpdateTime();
public UpdateTime()
{
    gettime(hour, minute);
    format(timestr,32,"%02d:%02d",hour,minute);
    TextDrawSetString(txtTimeDisp,timestr);

    SetWorldTime(hour);

    new x=0;
    while(x!=MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE)
        {
            SetPlayerTime(x,hour,minute);
        }
        x++;
    }
    return 1;
}

//--------------------------------------------------

public OnFilterScriptInit()
{
    // Init our text display
    txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
    TextDrawUseBox(txtTimeDisp, 0);
    TextDrawFont(txtTimeDisp, 3);
    TextDrawSetShadow(txtTimeDisp,0); // no shadow
    TextDrawSetOutline(txtTimeDisp,2); // thickness 1
    TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
    TextDrawColor(txtTimeDisp,0xFFFFFFFF);
    TextDrawAlignment(txtTimeDisp,3);
    TextDrawLetterSize(txtTimeDisp,0.5,1.5);

    UpdateTime();
    SetTimer("UpdateTime",60000,true);

    if(!fexist("dinheiro.ini")) dini_Create("dinheiro.ini");
    if(!fexist("score.ini")) dini_Create("score.ini");
    if(!fexist("Weapon.ini")) dini_Create("Weapon.ini");

    return 1;
}

//--------------------------------------------------

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,txtTimeDisp);

    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);

    if(dini_Isset("Weapon.ini",PlayerName(playerid))) GivePlayerWeapon(playerid,dini_Int("Weapon.ini",PlayerName(playerid)), 1000);

    return 1;
}

//--------------------------------------------------

public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid,txtTimeDisp);
    return 1;
}

//--------------------------------------------------

public OnPlayerConnect(playerid)
{
    if(dini_Isset("dinheiro.ini",PlayerName(playerid))) GivePlayerMoney(playerid,dini_Int("dinheiro.ini",PlayerName(playerid)));
    if(dini_Isset("score.ini",PlayerName(playerid))) SetPlayerScore(playerid,dini_Int("score.ini",PlayerName(playerid)));
    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    dini_IntSet("dinheiro.ini",PlayerName(playerid),GetPlayerMoney(playerid));
    dini_IntSet("score.ini",PlayerName(playerid),GetPlayerScore(playerid));
    dini_IntSet("Weapon.ini",PlayerName(playerid),GetPlayerWeapon(playerid));
    return 1;
}

stock PlayerName(playerid)
{
    new Name[MAX_PLAYERS];
    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}


public OnFilterScriptExit()
{
    return 1;
}
//--------------------------------------------------

Espero ter ajudado .
Reply


Messages In This Thread
[Ajuda] FS de DINI bugando dedicado - by arakuta - 07.07.2011, 23:46
Re: [Ajuda] FS de DINI bugando dedicado - by Transferencia - 07.07.2011, 23:51
Re: [Ajuda] FS de DINI bugando dedicado - by arakuta - 08.07.2011, 00:03
Re: [Ajuda] FS de DINI bugando dedicado - by Andrew_Guiga - 08.07.2011, 00:32
Re: [Ajuda] FS de DINI bugando dedicado - by Shadoww5 - 08.07.2011, 01:13
Re: [Ajuda] FS de DINI bugando dedicado - by wallon - 08.07.2011, 01:47
Re: [Ajuda] FS de DINI bugando dedicado - by arakuta - 08.07.2011, 02:57
Re: [Ajuda] FS de DINI bugando dedicado - by rjjj - 08.07.2011, 03:09
Re: [Ajuda] FS de DINI bugando dedicado - by arakuta - 08.07.2011, 03:21

Forum Jump:


Users browsing this thread: 2 Guest(s)