Admin Scriptwünsch

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • hi,
    kann mir jemand für GF einen Command scripten, mit dem ich als Admin einen leader zu einem Civilian machen, also das gegenteil von /makeleader?


    Und ein Command mit dem ich als admin einen spieler in eine fraction einlade z.b. /adminvite [playerid] [fractionid].


    Schonmal Danke im Vorraus!!!

  • das würde mcih acuh wohl interessiern kann jemand sowas?


    ja am besten mit /unmakeleader id
    und mit /admininvite id fraktion
    das wär gut


    wen das jemand kann


    ^^ mfg
    hover

  • if(strcmp(cmd, "/rauswerfen", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "INFO: /rauswerfen [playerid/Spielername]");
    return 1;
    }
    new para1;
    para1 = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1336)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if (PlayerInfo[para1][pMember] > 0)
    {
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    printf("AdmCmd: %s has uninvited %s.", sendername, giveplayer);
    format(string, sizeof(string), "* Du wurdest aus der Fraktion geschmissen vom Admin %s.", sendername);
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    SendClientMessage(para1, COLOR_LIGHTBLUE, "* Du bist jetzt wieder Zivilist");
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
    PlayerInfo[para1][pMember] = 0;
    PlayerInfo[para1][pRank] = 0;
    PlayerInfo[para1][pChar] = 0;
    new rand = random(sizeof(CIV));
    SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
    PlayerInfo[para1][pModel] = CIV[rand];
    MedicBill[para1] = 0;
    SpawnPlayer(para1);
    format(string, sizeof(string), " Du hast %s aus der Fraktion geschmissen", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du darfst diesen Command nicht nutzen!");
    }
    }
    return 1;
    }

    Mfg. BlackFoX_UD_ alias [BFX]Explosion


  • dcmd_invite(playerid,paramas[])
    {
    if(pInfo[playerid][Admin] >=2)// wie du es definiert hast
    {
    new
    pID,
    team;
    if(sscanf(paramas, "dd",pID,team)
    {
    return SendClientMessage(playerid,farbe,"BENUTZUNG:/invite [ID] [Team]");
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,farbe,"Kein Spieler mit angegebener ID online");
    }
    new
    name,
    pname,
    string[128],
    s[128];
    GetPlayerName(playerid,pname,sizeof(pname));
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"Du wurdes vom Administrator %s in das Team %d eingestellt",pname,team);
    format(s,sizeof(s),"Du hast %d(ID:%s) ins Team %d eingestellt",name,pID,team);
    SendClientMessage(playerid,farbe,s);
    SendClientMessage(pID;fabre,string);
    gTeam[pID] = team; // habs jetzt mal mti gTeam gemacht
    }
    else
    {
    SendClientMessage(playerid,farbe,"DU bist kein Admin");
    return 1;
    }
    return 0;
    }


    OnPlayerCommandText
    dcmd(invite,6,cmdtext)


    du musst natürlich dcmd und sscanf definiert haben


    und getestet

  • #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
    stock sscanf(string[], format[], {Float,_}:...)
    {
    if (!strlen(string))
    {
    return format[0];
    }
    new
    formatPos = 0,
    stringPos = 0,
    paramPos = 2,
    paramCount = numargs(),
    delim = ' ';
    while (paramPos < paramCount && string[stringPos])
    {
    switch (format[formatPos++])
    {
    case '\0':
    {
    return 0;
    }
    case 'i', 'd':
    {
    new
    neg = 1,
    num = 0,
    ch = string[stringPos];
    if (ch == '-')
    {
    neg = -1;
    ch = string[++stringPos];
    }
    do
    {
    stringPos++;
    if (ch >= '0' && ch <= '9')
    {
    num = (num * 10) + (ch - '0');
    }
    else
    {
    return -1;
    }
    }
    while ((ch = string[stringPos]) > ' ' && ch != delim);
    setarg(paramPos, 0, num * neg);
    }
    case 'h', 'x':
    {
    new
    ch,
    num = 0;
    while ((ch = string[stringPos]) > ' ' && ch != delim)
    {
    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;
    }
    }
    }
    setarg(paramPos, 0, num);
    }
    case 'c':
    {
    setarg(paramPos, 0, string[stringPos++]);
    }
    case 'f':
    {
    setarg(paramPos, 0, _:floatstr(string[stringPos]));
    }
    case 'p':
    {
    delim = format[formatPos++];
    continue;
    }
    case 's', 'z':
    {
    new
    i = 0,
    ch;
    if (format[formatPos])
    {
    while ((ch = string[stringPos++]) && ch != delim)
    {
    setarg(paramPos, i++, ch);
    }
    if (!i)
    {
    return -1;
    }
    }
    else
    {
    while ((ch = string[stringPos++]))
    {
    setarg(paramPos, i++, ch);
    }
    }
    stringPos--;
    setarg(paramPos, i, '\0');
    }
    default:
    {
    continue;
    }
    }
    while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
    {
    stringPos++;
    }
    while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
    {
    stringPos++;
    }
    paramPos++;
    }
    while (format[formatPos] == 'z') formatPos++;
    if (format[formatPos] > ' ') return format[formatPos];
    return 0;
    }

  • das mit /rauswerfen hat nur bei Member gefunzt und dann hab ich es nochma für Leader überarbeitet. Vielen Dank!!!!


    if(strcmp(cmd, "/auninvite", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /auninvite [playerid]");
    return 1;
    }
    new para1;
    para1 = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if (PlayerInfo[para1][pMember] > 0)
    {
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    printf("Admin: %s was uninvited by an Admin.", giveplayer);
    format(string, sizeof(string), "* You was kicked from you fraction by an Admin.");
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    SendClientMessage(para1, COLOR_LIGHTBLUE, "* You are now a Civilian");
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
    PlayerInfo[para1][pMember] = 0;
    PlayerInfo[para1][pRank] = 0;
    PlayerInfo[para1][pChar] = 0;
    new rand = random(sizeof(CIV));
    SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
    PlayerInfo[para1][pModel] = 26;
    MedicBill[para1] = 0;
    SpawnPlayer(para1);
    format(string, sizeof(string), " You kicked %s from his fraction.", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    else if (PlayerInfo[para1][pLeader] > 0)
    {
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    printf("Admin: %s was kicked from his Leader Job by an Admin.", giveplayer);
    format(string, sizeof(string), "* You was kicked from your Leader Job by an Admin.");
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    SendClientMessage(para1, COLOR_LIGHTBLUE, "* You are now a Civilian");
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
    PlayerInfo[para1][pLeader] = 0;
    PlayerInfo[para1][pRank] = 0;
    PlayerInfo[para1][pChar] = 0;
    new rand = random(sizeof(CIV));
    SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
    PlayerInfo[para1][pModel] = 26;
    MedicBill[para1] = 0;
    SpawnPlayer(para1);
    format(string, sizeof(string), " You kicked %s from his Leader Job.", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that Command!");
    }
    }
    return 1;
    }


    aber @ Weed wo is da das Command oder wo muss es hin? Sieht super aus!!!


    MfG Coca_Cola

  • das aun invite geht irg wie nicht ....
    ps .. das teil muss einfach mal ganz unten oder irg wo rein

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • habs genauso gemacht wies erklärt war


    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(9090) : error 017: undefined symbol "dcmd_invite"
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16010) : error 017: undefined symbol "dcmd_invite"
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16017) : error 017: undefined symbol "paramas"
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16028) : warning 219: local variable "string" shadows a variable at a preceding level
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16030) : error 035: argument type mismatch (argument 2)
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16030) : error 035: argument type mismatch (argument 2)
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16031) : error 035: argument type mismatch (argument 2)
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16031) : error 035: argument type mismatch (argument 2)
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16043) : warning 217: loose indentation
    D:\GEM Role Play Server\GEM Role Play\gamemodes\GEM.pwn(16045) : warning 225: unreachable code
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    7 Errors.



    geht es nich iwie einfacher? oder kann wer mir die errors wegmachen?