Jump to content
  • 0

Eroare : array must be indexed (variable "Hacker")


iNTeL.

Question

Problema intalnita (descriere): Am adaugat https://www.sa-mp.ro/forums/topic/20406-tutorial-anti-s0b/ totul a mers bine pana la aadaugarea comenzii /hackers.
Ero(area / rile) / warning-(ul / urile): C:\Users\salam\Downloads\rG3-gamemode-master\rG3-gamemode-master\gamemodes\rg3.pwn(12820) : error 033: array must be indexed (variable "Hacker")
Liniile de cod / sursa / script-ul(obligatoriu):  if(Hacker == 1)
Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: n-am reusit sa-i fac nimic..

 

Comanda :

CMD:hackers(playerid, params[])
{
    if(PlayerData[playerid][pAdmin] < 1) return SendClientMessage(playerid, red, "[ERROR]: Nu esti admin");
    SendClientMessage(playerid, 0x5DE85FFF, "|---- Playeri Online cu s0B -----|");
    new count = 0, str[200], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(Hacker == 1)
            {
                count++;
                format(str, sizeof(str), "%s[%d] ,", count, pName, i);
                SendClientMessage(playerid, 0xEF88F2FF, str);
            }
        }
    }
    {
        if(count == 0) return SendClientMessage(playerid, 0x99D45BFF, "Nu ai nici un player cu s0B pe server");
    }
    return 1;
}
Edited by iNTeL.
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Deci cu acel for() treci prin toate ID-urile playerilor de pe server. „i” memorează acel ID și la apel Hacker dacă are s0b, e 1 iar dacă nu, e 0; 

Pe scurt, este un vector ce memorează 0/1 pentru playerii de pe server;

Topic closed!

  • Upvote 1
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.