Jump to content

Problema server samp


Hizan Andrei

Recommended Posts

Salutare, stie cineva cum rezolv aasta? a fost un baiat mai inainte pe svr meu si a facut spam pe chat dar el nici macar nu era logat, era la inregistrare...


[14:07:51] [debug] #0 001ad508 in ?? (... <2 arguments>) at C:\pawno\gamemodes\nzone.pwn:6313
[14:07:51] [debug] #1 0002fc5c in public OnPlayerText (playerid=101, text[]=@028be5fc "flood_by_hpq<3") at C:\pawno\pawno\include\YSI\y_hooks/impl.inc:901
[14:07:51] [debug] Run time error 4: "Array index out of bounds"
[14:07:51] [debug]  Accessing element at index 101 past array upper bound 100

Stie cineva de la ce e?

Am verificat liniile acelea dar nu este nimic..

 

Link to comment
Share on other sites

Citat

public OnPlayerText (playerid=101, text[]=@028be5fc "flood_by_hpq<3")

Citat

[14:07:51] [debug] Run time error 4: "Array index out of bounds"
[14:07:51] [debug]  Accessing element at index 101 past array upper bound 100

Cel mai probabil ai mai multe sloturi de 100 si cel mai probabil undeva la OnPlayerText (sau ceva ce face hook la callback) foloseste un array pentru playeri care nu a fost actualizat cum trebuie cu marimea necesara serverului. Ti-as recomanda sa folosesti MAX_PLAYERS pentru astfel de array care se foloseste pentru playeri astfel incat doar sa redefinesti valoarea MAX_PLAYERS cu valoarea de sloturi disponibile

Link to comment
Share on other sites

1 oră în urmă, Hizan Andrei a spus:

if(SearchIP(GetIP(playerid)) > 1) {
      SCM(playerid, COLOR_RED, "Ai deja un cont creat pe acest IP, daca crezi ca ai luat ban aiurea poti deschide un ticket pe panel."), KickEx(playerid);
}

Cum pot rezolva asta?
Primesc eroarea: error 035: argument type mismatch (argument 1)

if(SearchIP(GetIP(playerid)) > 1) {
      SCM(playerid, COLOR_RED, 
          !"Ai deja un cont creat pe acest IP, daca crezi ca ai luat ban aiurea poti deschide un ticket pe panel.");
      return 
        KickEx(playerid);
}

 

Edited by Khain Developer
Link to comment
Share on other sites

function SearchIP(playerid) {
    new name[MAX_PLAYER_NAME], idd[16], x;
    for(new i, j = cache_num_rows(); i < j; i++) {
        cache_get_field_content(i, "name", name);
        cache_get_field_content(i, "id", idd);        
        x++;
        gString[0] = EOS;
        format(gString, sizeof(gString), "%d. %s (user %d)", x, name, strval(idd));
        SCM(playerid, COLOR_WHITE, gString);
    }
    if(x == 0) SCM(playerid, COLOR_LGREEN, "Eroare: Nu au fost gasite alte conturi de pe acest IP!");
    return true;
}

Asta e linia cu searchip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.