Beiträge von The Sensei

    Guten Tag,
    ich benötige Hilfe bei meinem AdminChat System.


    Ich habe alles Gescriptet mir fehlt lediglich (warscheinlich ein Stock) damit das nur bei den Admin´s ankommt.


    Könnt ihr mir erklären wie das geht da ich gerade nicht wusste wie.
    Falls ich was falsch gemacht habe schreibt es dazu aber der Pawno Compiler hat mir nix angezeigt.



    Aktueller Code :


    ocmd:a(playerid,params[])
    {
    if(!GetPVarInt(playerid,"Adminlevel")) return SendClientMessage(playerid,-1,"");
    if(!params[0]) return SendClientMessage(playerid,-1,"Verwendung: /a [Text]");
    new text[144],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(text,144,"*[Admin-Chat] %s: %s:",a_rang[GetPVarInt(playerid,"Adminlevel")],name,params);
    return 1;
    }


    Meine Adminabfrage :
    if(isPlayerAnAdmin(playerid,(AdminRang));

    Was soll ich mit dem Pastebin machen???.
    Hab den Ersten link jetzt jetzt alles ersetzt.
    Was drinne.
    Was nun?


    //e 2 Error Aufgetreten.


    In der Rcon Console steht "File or Function is not Found"


    Code: #include <sscanf2>
    Dann alles aus dem Ersten Link ersetzt.
    Stock gelöscht.

    Also Diesen Stock


    stock sscanf(sstring[], format[], {Float,_}:...)
    {
    #if defined isnull
    if (isnull(sstring))
    #else
    if (sstring[0] == 0 || (sstring[0] == 1 && sstring[1] == 0))
    #endif
    {
    return format[0];
    }
    #pragma tabsize 4
    new
    formatPos = 0,
    sstringPos = 0,
    paramPos = 2,
    paramCount = numargs(),
    delim = ' ';
    while (sstring[sstringPos] && sstring[sstringPos] <= ' ')
    {
    sstringPos++;
    }
    while (paramPos < paramCount && sstring[sstringPos])
    {
    switch (format[formatPos++])
    {
    case '\0':
    {
    return 0;
    }
    case 'i', 'd':
    {
    new
    neg = 1,
    num = 0,
    ch = sstring[sstringPos];
    if (ch == '-')
    {
    neg = -1;
    ch = sstring[++sstringPos];
    }
    do
    {
    sstringPos++;
    if ('0' <= ch <= '9')
    {
    num = (num * 10) + (ch - '0');
    }
    else
    {
    return -1;
    }
    }
    while ((ch = sstring[sstringPos]) > ' ' && ch != delim);
    setarg(paramPos, 0, num * neg);
    }
    case 'h', 'x':
    {
    new
    num = 0,
    ch = sstring[sstringPos];
    do
    {
    sstringPos++;
    switch (ch)
    {
    case 'x', 'X':
    {
    num = 0;
    continue;
    }
    case '0' .. '9':
    {
    num = (num << 4) | (ch - '0');
    }
    case 'a' .. 'f':
    {
    num = (num << 4) | (ch - ('a' - 10));
    }
    case 'A' .. 'F':
    {
    num = (num << 4) | (ch - ('A' - 10));
    }
    default:
    {
    return -1;
    }
    }
    }
    while ((ch = sstring[sstringPos]) > ' ' && ch != delim);
    setarg(paramPos, 0, num);
    }
    case 'c':
    {
    setarg(paramPos, 0, sstring[sstringPos++]);
    }
    case 'f':
    {


    new changestr[16], changepos = 0, strpos = sstringPos;
    while(changepos < 16 && sstring[strpos] && sstring[strpos] != delim)
    {
    changestr[changepos++] = sstring[strpos++];
    }
    changestr[changepos] = '\0';
    setarg(paramPos,0,_:floatstr(changestr));
    }
    case 'p':
    {
    delim = format[formatPos++];
    continue;
    }
    case '\'':
    {
    new
    end = formatPos - 1,
    ch;
    while ((ch = format[++end]) && ch != '\'') {}
    if (!ch)
    {
    return -1;
    }
    format[end] = '\0';
    if ((ch = strfind(sstring, format[formatPos], false, sstringPos)) == -1)
    {
    if (format[end + 1])
    {
    return -1;
    }
    return 0;
    }
    format[end] = '\'';
    sstringPos = ch + (end - formatPos);
    formatPos = end + 1;
    }
    case 'u':
    {
    new
    end = sstringPos - 1,
    id = 0,
    bool:num = true,
    ch;
    while ((ch = sstring[++end]) && ch != delim)
    {
    if (num)
    {
    if ('0' <= ch <= '9')
    {
    id = (id * 10) + (ch - '0');
    }
    else
    {
    num = false;
    }
    }
    }
    if (num && IsPlayerConnected(id))
    {
    setarg(paramPos, 0, id);
    }
    else
    {
    #if !defined foreach
    #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
    #define __SSCANF_FOREACH__
    #endif
    sstring[end] = '\0';
    num = false;
    new
    name[MAX_PLAYER_NAME];
    id = end - sstringPos;
    foreach (Player, playerid)
    {
    GetPlayerName(playerid, name, sizeof (name));
    if (!strcmp(name, sstring[sstringPos], true, id))
    {
    setarg(paramPos, 0, playerid);
    num = true;
    break;
    }
    }
    if (!num)
    {
    setarg(paramPos, 0, INVALID_PLAYER_ID);
    }
    sstring[end] = ch;
    #if defined __SSCANF_FOREACH__
    #undef foreach
    #undef __SSCANF_FOREACH__
    #endif
    }
    sstringPos = end;
    }
    case 's', 'z':
    {
    new
    i = 0,
    ch;
    if (format[formatPos])
    {
    while ((ch = sstring[sstringPos++]) && ch != delim)
    {
    setarg(paramPos, i++, ch);
    }
    if (!i)
    {
    return -1;
    }
    }
    else
    {
    while ((ch = sstring[sstringPos++]))
    {
    setarg(paramPos, i++, ch);
    }
    }
    sstringPos--;
    setarg(paramPos, i, '\0');
    }
    default:
    {
    continue;
    }
    }
    while (sstring[sstringPos] && sstring[sstringPos] != delim && sstring[sstringPos] > ' ')
    {
    sstringPos++;
    }
    while (sstring[sstringPos] && (sstring[sstringPos] == delim || sstring[sstringPos] <= ' '))
    {
    sstringPos++;
    }
    paramPos++;
    }
    do
    {
    if ((delim = format[formatPos++]) > ' ')
    {
    if (delim == '\'')
    {
    while ((delim = format[formatPos++]) && delim != '\'') {}
    }
    else if (delim != 'z')
    {
    return delim;
    }
    }
    }
    while (delim > ' ');
    return 0;
    }
    löschen???
    Und welche plugins updaten???

    Einen Fehler hab ich noch.


    Code: ocmd:acp(playerid,params[])
    {
    if(!isPlayerAnAdmin(playerid,5)) return SendClientMessage(playerid,ROT,"Zugriff Verweigert");
    new pID;
    if(sscanf(params,"u",pID))return SendClientMessage(playerid,-1,"/acp [playerid]");
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,ROT,"Spieler ist nicht Online");
    new string[256];
    format(string, sizeof(string), "Name: %s\n",SpielerName(pID));
    format(string, sizeof(string), "Sanktionen:\n");
    format(string, sizeof(string), "%sTimebans: %d\n",string,GetPVarInt(playerid,"Banned1"));
    format(string, sizeof(string), "%sKicks: %d\n",string,GetPVarInt(playerid,"Banned2"));
    format(string, sizeof(string), "Sonstiges: \n");
    format(string, sizeof(string), "");
    return ShowPlayerDialog(playerid,DIALOG_ACP,DIALOG_STYLE_MSGBOX,"Admin Control Panel",string,"Ok","");
    }


    Error´s:

    Code
    Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


    Es kommt Garnichts ingame auser /acp [playerid]

    ocmd:acp(playerid,params[])
    {
    if(!isPlayerAnAdmin(playerid,5)) return SendClientMessage(playerid,ROT,"Zugriff Verweigert");
    new string1[200],string2[200],string3[128],pID,rest[500];
    if(sscanf(params,"u",pID))return SendClientMessage(playerid,-1,"/acp [playerid]");
    if(IsPlayerConnected(pID))
    {
    format(string1, sizeof string1, "Name: %s",SpielerName(pID));
    format(string2, sizeof string2, "Timebans: %s",GetPVarInt(playerid,"Banned1"));
    format(string3, sizeof string3, "Kicks: %s",GetPVarInt(playerid,"Banned2"));
    format(rest, sizeof rest, "%s\n%s\n%s\n", string1,string2,string3);
    if(!isPlayerAnAdmin(playerid,5)) return ShowPlayerDialog(playerid,DIALOG_ACP,DIALOG_STYLE_MSGBOX,"Admin Control Panel",rest,"Ok","");
    }
    SendClientMessage(playerid,ROT,"Spieler ist nicht Online");
    return 1;
    }

    ocmd:tban(playerid,params[])
    {
    if(!isPlayerAnAdmin(playerid,2))return SendClientMessage(playerid,ROT,"Rang zu Niedrig.");
    new pID, time, grund[128];
    if(sscanf(params,"uis",pID,time,grund))return SendClientMessage(playerid,BLAU,"/tban [playerid] [zeit] [grund]");
    if(IsPlayerConnected(pID))
    {
    if(time>0&&time<1000)
    {
    new string[128];
    format(string,sizeof(string),"%s wurde von %s für %i Minuten gebannt. Grund: %s",SpielerName(pID),SpielerName(playerid),time,grund);
    SendClientMessageToAll(ROT,string);
    new wert;


    wert=gettime()+(60*time);


    SetPVarInt(pID,"timeban",wert);
    SetTimerEx("WarnTimer2", 250, false, "i", pID);
    SetPVarInt(playerid,"Banned?",GetPVarInt(playerid,"Banned?")+1);//Da
    Kick(pID);
    return 1;
    }
    SendClientMessage(playerid,ROT,"Ungültige Zeit.");
    return 1;
    }
    SendClientMessage(playerid,ROT,"Spieler ist nicht online.");
    return 1;
    }
    ErikSon: