#1

pawn Код:
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(36) : error 010: invalid function or declaration
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(38) : error 021: symbol already defined: "KillTimer"
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(53) : warning 217: loose indentation
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(85) : warning 235: public function lacks forward declaration (symbol "ScorenPing")
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(119) : warning 203: symbol is never used: "Updater"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
ERRORS
MAIN CODE
pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

new Text:scoreandping[MAX_PLAYERS];
new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
new Updater;
// OnGameModeInIt And/Or OnFilterscriptInIt();
Updater = SetTimer("ScoreandPing", 1000, 1);
// OnGameModeExit And/Or OnFilterScriptExit();
KillTimer(Updater);
// OnPlayerConnect Stuff.
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,-1," This Server Uses lScore'n'Ping System By Littlehelper AKA iKing");
    scoreandping[playerid] = TextDrawCreate(10.000000,430.000000,"Loading Statistics!");
    TextDrawAlignment(scoreandping[playerid],0);
    TextDrawBackgroundColor(scoreandping[playerid],0x000000ff);
    TextDrawFont(scoreandping[playerid],1);
    TextDrawLetterSize(scoreandping[playerid],0.500000,1.5);
    TextDrawColor(scoreandping[playerid],0xffffffff);
    TextDrawSetOutline(scoreandping[playerid],1);
    TextDrawSetProportional(scoreandping[playerid],1);
    TextDrawSetShadow(scoreandping[playerid],1);
    TextDrawShowForPlayer(playerid, scoreandping[playerid]);
     return 1;
}
// OnPlayerDisconnect Stuff.
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawDestroy(scoreandping[playerid]);
    return 1;
}
// Publics.
public OnPlayerUpdate(playerid) {

    // handle fps counters.
    new drunknew;
    drunknew = GetPlayerDrunkLevel(playerid);

    if (drunknew < 100) { // go back up, keep cycling.
        SetPlayerDrunkLevel(playerid, 2000);
    } else {

        if (pDrunkLevelLast[playerid] != drunknew) {

            new wfps = pDrunkLevelLast[playerid] - drunknew;

            if ((wfps > 0) && (wfps < 200))
                pFPS[playerid] = wfps;

            pDrunkLevelLast[playerid] = drunknew;
        }

    }

}
public ScorenPing(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[256];
            format(string,sizeof(string),"Score:~b~%d ~w~Ping:~b~%d ~w~FPS:~b~%d",GetPlayerScore(playerid),GetPlayerPing(playerid),GetPlayerFPS(playerid));
            TextDrawSetString(scoreandping[i], string);
        }
    }
}
// Added FPS On Request.
stock GetPlayerFPS(playerid)
{
    SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
    if(GetPVarInt(playerid, "DrunkL") < 100)
    {
        SetPlayerDrunkLevel(playerid, 2000);
    }
    else
    {
        if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
        {
            SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
            SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
            if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
            {
                return GetPVarInt(playerid, "FPS") - 1;
            }
        }
    }
    return 0;
}
Reply
#2

pawn Код:
forward ScorenPing(playerid);
public ScorenPing(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[256];
            format(string,sizeof(string),"Score:~b~%d ~w~Ping:~b~%d ~w~FPS:~b~%d",GetPlayerScore(playerid),GetPlayerPing(playerid),GetPlayerFPS(playerid));
            TextDrawSetString(scoreandping[i], string);
        }
    }
}
Reply
#3

Too many code
Reply
#4

Again man
pawn Код:
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(36) : error 010: invalid function or declaration
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(38) : error 021: symbol already defined: "KillTimer"
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(53) : warning 217: loose indentation
E:\Main\Life of Flying 0.3x (1)\Life of Flying 0.3x\gamemodes\Untitled.pwn(120) : warning 203: symbol is never used: "Updater"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

remove this line
pawn Код:
KillTimer(Updater);
Reply
#6

you can't set timer outside of callback use it like dis

pawn Код:
new Updater[MAX_PLAYERS];
// OnGameModeExit And/Or OnFilterScriptExit();

// OnPlayerConnect Stuff.
public OnPlayerConnect(playerid)
{

 Updater[playerid] = SetTimerEx("ScoreandPing", 1000, 1,"d",playerid);

 //.. rest of code
 return 1;
}
and the kill the player timer when he/she quit
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(Updater[playerid]);
    return 1;
}
Reply
#7

Where you
public OnGameModeInit()
and
public OnGameModeExit()
?

Код:
public OnGameModeInit()
{
  Updater = SetTimer("ScoreandPing", 1000, 1);
  return 1;
}
Код:
public OnGameModeExit()
{
KillTimer(Updater);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)