Jump to content
  • 0

Probleme compilare


em1nnem17

Question

Cumar fi corect sa scriu acest algoritm:

[new Text:scoreandping[MAX_PLAYERS];
new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
new Updater;
// OnGameModeInIt And/Or OnFilterscriptInIt();
Updater = SetTimer("ScorenPing", 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;
}
Astfel incat sa nu mai imi de-a aceste erori:
C:\Documents and Settings\Last\Desktop\ma.pwn(68) : error 017: undefined symbol "MAX_PLAYERS"
C:\Documents and Settings\Last\Desktop\ma.pwn(1) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Last\Desktop\ma.pwn(2) : error 017: undefined symbol "MAX_PLAYERS"
C:\Documents and Settings\Last\Desktop\ma.pwn(2) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Last\Desktop\ma.pwn(3) : error 017: undefined symbol "MAX_PLAYERS"
C:\Documents and Settings\Last\Desktop\ma.pwn(3) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Last\Desktop\ma.pwn(6) : error 010: invalid function or declaration
C:\Documents and Settings\Last\Desktop\ma.pwn(8) : warning 219: local variable "Updater" shadows a variable at a preceding level
C:\Documents and Settings\Last\Desktop\ma.pwn(10) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
C:\Documents and Settings\Last\Desktop\ma.pwn(12) : error 017: undefined symbol "SendClientMessage"
C:\Documents and Settings\Last\Desktop\ma.pwn(13) : error 017: undefined symbol "TextDrawCreate"
C:\Documents and Settings\Last\Desktop\ma.pwn(13) : warning 213: tag mismatch
C:\Documents and Settings\Last\Desktop\ma.pwn(14) : error 017: undefined symbol "TextDrawAlignment"
C:\Documents and Settings\Last\Desktop\ma.pwn(15) : error 017: undefined symbol "TextDrawBackgroundColor"
C:\Documents and Settings\Last\Desktop\ma.pwn(16) : error 017: undefined symbol "TextDrawFont"
C:\Documents and Settings\Last\Desktop\ma.pwn(17) : error 017: undefined symbol "TextDrawLetterSize"
C:\Documents and Settings\Last\Desktop\ma.pwn(18) : error 017: undefined symbol "TextDrawColor"
C:\Documents and Settings\Last\Desktop\ma.pwn(19) : error 017: undefined symbol "TextDrawSetOutline"
C:\Documents and Settings\Last\Desktop\ma.pwn(20) : error 017: undefined symbol "TextDrawSetProportional"
C:\Documents and Settings\Last\Desktop\ma.pwn(21) : error 017: undefined symbol "TextDrawSetShadow"
C:\Documents and Settings\Last\Desktop\ma.pwn(22) : error 017: undefined symbol "TextDrawShowForPlayer"
C:\Documents and Settings\Last\Desktop\ma.pwn(23) : warning 217: loose indentation
C:\Documents and Settings\Last\Desktop\ma.pwn(26) : warning 235: public function lacks forward declaration (symbol "OnPlayerDisconnect")
C:\Documents and Settings\Last\Desktop\ma.pwn(28) : error 017: undefined symbol "TextDrawDestroy"
C:\Documents and Settings\Last\Desktop\ma.pwn(32) : warning 235: public function lacks forward declaration (symbol "OnPlayerUpdate")
C:\Documents and Settings\Last\Desktop\ma.pwn(36) : error 017: undefined symbol "GetPlayerDrunkLevel"
C:\Documents and Settings\Last\Desktop\ma.pwn(39) : error 017: undefined symbol "SetPlayerDrunkLevel"
C:\Documents and Settings\Last\Desktop\ma.pwn(55) : warning 235: public function lacks forward declaration (symbol "ScorenPing")
C:\Documents and Settings\Last\Desktop\ma.pwn(57) : error 017: undefined symbol "MAX_PLAYERS"
C:\Documents and Settings\Last\Desktop\ma.pwn(59) : error 017: undefined symbol "IsPlayerConnected"
C:\Documents and Settings\Last\Desktop\ma.pwn(62) : error 017: undefined symbol "format"
C:\Documents and Settings\Last\Desktop\ma.pwn(62) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Last\Desktop\ma.pwn(62) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Last\Desktop\ma.pwn(62) : error 017: undefined symbol "GetPlayerScore"
C:\Documents and Settings\Last\Desktop\ma.pwn(63) : error 017: undefined symbol "TextDrawSetString"

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

[pawn]#include <a_samp>

new Text:scoreandping[MAX_PLAYERS];

new pDrunkLevelLast[MAX_PLAYERS];

new pFPS[MAX_PLAYERS];

new Updater;

forward ScorenPing(playerid);

public OnFilterScriptInit()// OnGameModeInIt And/Or OnFilterscriptInIt();

{

Updater = SetTimer("ScorenPing", 1000, 1);

}

public OnFilterScriptExit()// 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, 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;

}[/pawn]

Titlu!

gXvsYS
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.