[Pomoc]Erorrs

Započeo Schwarz, April 07, 2013, 14:12:43 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: public OnPlayerDeath(playerid, killerid, reason)
{
antifakekill[i] ++;

Error: D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(10438) : error 017: undefined symbol "i"
public antifakekill2()
{
    antifakekill[i] --;
    if(antifakekill[i] > 5)
    {
    new string[128];
format(string,sizeof(string),"[LG Security] %s [ID : %d] Mozebi koristi FakeDeath, proverete go!!", PlayerName(i),i,antifakekill[i]);
PorukaAdminu(-1,string); //ovo cu vam pojasnit dole
    }
    return 1;
}

Erore:D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17728) : error 017: undefined symbol "i"
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17729) : error 017: undefined symbol "i"
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17732) : error 017: undefined symbol "i"

Detaljan opis problema:
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):

ne mozes tako antifakekill[playerid] ++;

public antifakekill2()
{
    antifakekill[playerid] --;
    if(antifakekill[playerid] > 5)
    {
    new string[128];
format(string,sizeof(string),"[LG Security] %s [ID : %d] Mozebi koristi FakeDeath, proverete go!!", PlayerName(i),i,antifakekill[playerid]);
PorukaAdminu(-1,string); //ovo cu vam pojasnit dole
    }
    return 1;
}


D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17728) : error 017: undefined symbol "playerid"
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17729) : error 017: undefined symbol "playerid"
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17732

Uvek mesam ovo jel mi mozes malo pojasniti gde da koristim [playerid] a gde
Poslednja Izmena: April 07, 2013, 14:22:18 POSLE PODNE od |LG|Hawk

na vrh forward AntiFakekillTimer(playerid); na vrh new AntiFakekill[MAX_PLAYERS];
new antifakekill[MAX_PLAYERS];
pod onplayerdeath AntiFakekill[playerid]++;
    SetTimerEx("AntiFakekillTimer", 1000,false,"i",playerid);
    antifakekill[playerid] ++;
    SetTimerEx("antifakekill2", 1000,false,"i",playerid);
forward antifakekill2(playerid);
public antifakekill2(playerid)
{
    antifakekill[playerid] --;
    DeathSpam{ playerid }++;
    if( DeathSpam{ playerid } == 3 )
    if(antifakekill[playerid] > 5)
    {
        SendClientMessage(playerid, -1, "{FFFFFF}Fake kill je zabranjen na ovom serveru, bannovani ste!");
        Ban(playerid);
    }
    return 1;
}
public AntiFakekillTimer(playerid)
{
    AntiFakekill[playerid]--;
    if(AntiFakekill[playerid] > 2)
    {
        #if defined Kickplayer
        SendClientMessage(playerid, -1, "{FFFFFF}Fake kill je zabranjen na ovom serveru!");
        TogglePlayerControllable(playerid, false);
        Ban(playerid);
        #else
        SendClientMessage(playerid, -1, " {FFFFFF}Fake kill je zabranjen na ovom serveru!");
        TogglePlayerControllable(playerid, false);
        Ban(playerid);
        #endif
    }
    return 1;
}

Mozes li mi reci samo kako da popravim ove moje erore netreba mi mene to ?

ja sam ti napravio isti princip samo sam ti fixovao errore

Da ne otvaram drugu temu pa cu te pitat ovde:
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17721) : error 032: array index out of bounds (variable "PlayerInfo")
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17721) : error 029: invalid expression, assumed zero
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17724) : error 017: undefined symbol "playerid"


public OneSecondTimer() // In this case, we want to call this little timer, "OneSecondTimer"
{ // Start

    for(new i = 0; i < MAX_PLAYERS; i++) // Basic loop to run this procedure on all players.
    { // Start
        if(IsPlayerConnected(i)) // It verifies and confirms if the player is connected.
        { // Start
            new Float: armor; // Armors are all float.  We need this to be able to use the GetPlayerArmor.
            new GetArmor = GetPlayerArmour(i, armor); // We want to make it a little shorter, so decided to name GetPlayerArmor with GetArmor to make it easier and faster to type.

            if(GetArmor > 100 && PlayerInfo[pAdmin] >= 1 || PlayerInfo[pTester] >= 1)) // It checks if the player armor's is above 99, and he is not an RCON administrator, therefore, RCON administrators will not have themselves kicked for hacks.
            { // Start
                new string[256], pname[MAX_PLAYER_NAME]; // We define a string to be using for SendClientMessage() which means to send a message to a specific person,
                GetPlayerName(playerid, pname, sizeof(pname)); // We use GetPlayerName() to get the player's name, self explanatory.
                format(string, sizeof(string), "[LG Security] %s mozebi koristi Healt Hack proverete go!!", pname); // Here we attach a whole text to the string, you may change this as you want, %s refers to the player's name, as at the end, you can see "pname" which means the first %s you can find
                ABroadCast(COLOR_YELLOW,string);
            TBroadCast(COLOR_YELLOW,string);
            } // Close
        } // Close
    } // Close
} // Close

vidis da si preko MAX_PLAYERSA loopao sve igrace ,kako mozes koristiti playerid ?

Pa ovako je bio tut sta sam nasao jel mi mozes ovo srediti ?


A za ovo sta mi daje eror: if(GetArmor > 100 && PlayerInfo[pAdmin] >= 1 || PlayerInfo[pTester] >= 1))

to je PlayerInfo indexovan drugacije, tebi je sigurno ovako PlayerInfo[playerid][pAdmin]

Opet daje 2 erora: D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17721) : error 017: undefined symbol "playerid"
D:\Documents and Settings\Miki\Desktop\Roleplay\gamemodes\rp.pwn(17721) : error 029: invalid expression, assumed zero


Na liniju if(GetArmor > 100 && PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1))

stavis umesto playerid , "i"

Hvala care resio sam problem.
Jel mi mozes dati nekoj tut za antiteleport sa tajmerom ne sa PlayerUpadate ??