Hilfe mit admin sys

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
  • Hallo,
    bin noch recht ein anfänger im Scripten und wollte fragen ob es da i-wo ein schönes tut gibt wo man sowas nachlesen kann ^^ ich hab zwar da schon was mit einem befehl aber mein Compiler stürtzt da immer ab


    #include <a_samp>



    enum Info
    {
    AdminLevel
    }
    new PlayerInfo[MAX_PLAYERS][Info];



    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    PlayerInfo[playerid][AdminLevel] = 0;
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    public OnPlayerPrivmsg(playerid, recieverid, text[])
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])


    strtok(const string[], &index)
    {
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
    index++;
    }


    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }
    result[index - offset] = EOS;
    return result;
    }


    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/makeadmin", true) == 0)
    {
    new string[128];
    new tmp[256];
    new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
    new giveplayerid;
    if (IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, ORANGE, "USAGE: /makeadmin [playerid] [level]");
    SendClientMessage(playerid, ORANGE, "FUNCTION: Player will be an admin.");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    new level = strval(tmp);
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, player, sizeof(player));
    PlayerInfo[giveplayerid][AdminLevel] = level;
    printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
    format(string, sizeof(string), "Du wurdest soeben zum %d Admin gemacht.", level, player);
    SendClientMessage(giveplayerid, 0x00C2ECFF, string);
    format(string, sizeof(string), "Du hast %s zum %d Admin gemacht.", giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
    SendClientMessage(playerid, 0x00C2ECFF, string);
    }
    else if(giveplayerid == INVALID_PLAYER_ID)
    {
    format(string, sizeof(string), "%i ist nicht online.", giveplayerid);
    SendClientMessage(playerid, 0xE60000FF, string);
    }
    }
    else
    {
    SendClientMessage(playerid, 0xE60000FF, "Du darfst diesen Befehl nicht verwenden!");
    }
    return 1;
    }




    public OnPlayerInfoChange(playerid)
    {
    return 1;
    }


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnRconCommand(cmd[])
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }

    Zitat

    naja aufm homeserver mit kumpel getestet und nix laggt von daher sollte nen richtiger server mit sowas keine probs haben

    *an Kopf schlag
    sowas kommt Raus wenn man erst absendet ohne nachzudenken. Bitte Leute Hirn einschalten beim Posten...

    2 Mal editiert, zuletzt von PaddyBoy ()