Admin Befehle selbst erstellen wie?

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
  • Guten tag Community ,


    ich wollte ein Dialog Teleport erstellen der nur ein Admin level 1 benutzen kan.





    if (IsPlayerAdmin(playerid)) // wenn ich das ran hänge kann es nur Rcon admin benutzen,wie mache ich das , das Admin level 1 benutzen kann (nur)



    {
    if(strcmp(cmdtext,"/ports",true)==0)
    {
    if (IsPlayerAdmin(playerid))
    ShowPlayerDialog(playerid,DIALOG_SPAWN,DIALOG_STYLE_MSGBOX,"Ports","Wo möchten sie hin?","BSN","LSPD");
    else
    {
    SendClientMessage(playerid, COLOR_BLAU, "Du Bist Kein Admin!");
    }


    return 1;
    }
    return 0;
    }



    Hoffe auf eine schnelle antwort.



    MFG SHOXI

  • Ich habe


    enum spieler_daten
    {
    wanted,
    skin,
    Float:lastx,Float:lasty,Float:lastz,
    eingeloggt,
    AdminLevel
    }


    public OnPlayerConnect(playerid)
    {
    new pname[MAX_PLAYERS],accFormat[128];


    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);


    if(fexist(accFormat))
    {
    ShowPlayerDialog
    (playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    }
    else
    {
    ShowPlayerDialog
    (playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    }


    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {



    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(fexist(accFormat) && Spieler[playerid][eingeloggt])
    {
    dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
    dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
    dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
    dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
    dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
    dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(accFormat,"Score",GetPlayerScore(playerid));
    dini_IntSet(accFormat,"AdminLevel",Spieler[playerid][AdminLevel]);
    }
    Spieler[playerid][eingeloggt] = 0;
    Spieler[playerid][wanted] = 0;
    Spieler[playerid][skin] = 0;
    Spieler[playerid][lastx] = (0.0);
    Spieler[playerid][lasty] = (0.0);
    Spieler[playerid][lastz] = (0.0);
    return 1;
    }

  • Dann muss deine Abfrage wie folgt lauten:
    if(Spieler[playerid][AdminLevel] >= 1)
    {
    //CODE
    }


    *edit*
    Du muss aber aufpassen, dass die Variable Spieler[playerid][AdminLevel] im ganzen Script gilt ;)

  • ich habe jez noch ein Problem


    wenn man sich registriert und dann neu Connected muss man sich nomma registrieren.


    ich poste ma ganzen script



    #include <a_samp>
    #include <dini>
    #include <sscanf>



    #define DIALOG_LOGIN 3
    #define DIALOG_REG 4
    #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
    #define COLOR_RED 0xB90000FF
    #define COLOR_YELLOW 0xC3FF00FF
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_BLUE 0x0A00FFFF
    #define GRAD2 0xBFC0C2FF
    #define GRAD5 0xBFC0C2FF
    #define COLOR_LIGHTGREEN 0x9ACD32AA
    #define COLOR_GELB 0xFFFF00FF
    #define COLOR_BLAU 0x0023FFFF


    #define DIALOG_SPAWN 1


    #define COLOR_REDA 0xFF0000FF//ServerOwner
    #define COLOR_LIGHTBLUE 0x33CCFFAA//Administrator
    #define COLOR_LIGHTGREEN 0x9ACD32AA//moderator
    #define COLOR_ORANGERED 0xFF4500AA//superadmin



    enum spieler_daten
    {
    wanted,
    skin,
    Float:lastx,Float:lasty,Float:lastz,
    eingeloggt,
    AdminLevel
    }



    new gAdmin[MAX_PLAYERS];
    new Tutorial[MAX_PLAYERS];
    new pInfo[MAX_PLAYERS];


    new bsnenter;
    new bsnexit;





    forward tuttimer(playerid);
    forward Score(playerid);



    new Spieler[MAX_PLAYERS][spieler_daten];




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




    public OnGameModeInit()
    {



    bsnenter=CreatePickup(1559,1,1199.1121,-918.1558,43.1241);
    bsnexit=CreatePickup(1559,1,362.9167,-75.2149,1001.5078);


    Create3DTextLabel("BSN\n Eingang",COLOR_BLAU,1199.1121,-918.1558,43.1241,10,0);


    DisableInteriorEnterExits();
    SetGameModeText("Script by Shoxi");
    AddPlayerClass(0,2070.4934,1355.3760,10.6719,153.8582,0,0,0,0,0,0); // Position
    AddPlayerClass(1,2070.4934,1355.3760,10.6719,153.8582,25,200,0,0,0,0); // Position


    AddStaticVehicle(411,1227.7511,-918.4766,42.5119,101.5333,123,1); // Auto1
    AddStaticVehicle(412,1227.1154,-914.8206,42.5121,99.1268,112,1); // Auto2
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid,2070.4934,1355.3760,10.6719); // Position
    SetPlayerFacingAngle(playerid,153.8582);
    SetPlayerCameraPos(playerid,2069.8442,1353.1063,10.6719);
    SetPlayerCameraLookAt(playerid,2070.4934,1355.3760,10.6719);
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    new pname[MAX_PLAYERS],accFormat[128];

    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);

    if(fexist(accFormat))
    {
    ShowPlayerDialog
    (playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    }
    else
    {
    ShowPlayerDialog
    (playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    }


    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {



    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(fexist(accFormat) && Spieler[playerid][eingeloggt])
    {
    dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
    dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
    dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
    dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
    dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
    dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(accFormat,"Score",GetPlayerScore(playerid));
    dini_IntSet(accFormat,"AdminLevel",Spieler[playerid][AdminLevel]);
    }
    Spieler[playerid][eingeloggt] = 0;
    Spieler[playerid][wanted] = 0;
    Spieler[playerid][skin] = 0;
    Spieler[playerid][lastx] = (0.0);
    Spieler[playerid][lasty] = (0.0);
    Spieler[playerid][lastz] = (0.0);
    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 OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext,"/ports",true)==0)
    {
    if (IsPlayerAdmin(playerid))
    ShowPlayerDialog(playerid,DIALOG_SPAWN,DIALOG_STYLE_MSGBOX,"Ports","Wo möchten sie hin?","BSN","LSPD");
    else
    {
    SendClientMessage(playerid, COLOR_BLAU, "Du Bist Kein Admin!");
    }


    return 1;
    }
    return 0;
    }


    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 OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


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


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid==bsnenter)
    {
    SetPlayerPos(playerid,364.4705,-73.7672,1001.5078);
    SetPlayerInterior(playerid,10);
    GameTextForPlayer(playerid,"~b~Du hast den~n~ BSN betreten.",3000,3);
    return 1;
    }
    if(pickupid==bsnexit)
    SetPlayerPos(playerid,1199.2083,-920.9971,43.0283);
    SetPlayerFacingAngle(playerid,187.0484);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,0);
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


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


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {


    if(dialogid==DIALOG_SPAWN)
    {
    if(response==1)
    {
    SetPlayerPos(playerid,1227.1154,-914.8206,42.5121);
    SendClientMessage(playerid,0xFFFF00FF,"Du wurdest zum BSN Teleportiert");
    }
    if(response==0)
    {
    SetPlayerPos(playerid,1542.9987,-1675.6642,13.5556);
    SendClientMessage(playerid,0xFFFF0FF,"Du wurdest zum LSPD Teleportiert");
    }
    }
    return 1;


    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(response)
    {
    switch(dialogid) // dialogid auswählen
    {
    case DIALOG_LOGIN: // ID Login
    {
    if(!strlen(inputtext))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
    }
    if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
    {
    Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
    Spieler[playerid][skin] = dini_Int(accFormat,"skin");
    Spieler[playerid][lastx] = dini_Float(accFormat,"lastx");
    Spieler[playerid][lasty] = dini_Float(accFormat,"lasty");
    Spieler[playerid][lastz] = dini_Float(accFormat,"lastz");
    GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
    SetPlayerScore(playerid,dini_Int(accFormat,"Score"));
    Spieler[playerid][AdminLevel] = dini_Int(accFormat, "AdminLevel");
    Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
    SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
    }
    }
    case DIALOG_REG: // ID Registrieren
    {
    if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
    {
    ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
    return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
    }
    dini_Create(accFormat);
    dini_Set(accFormat,"Passwort",inputtext);
    dini_IntSet(accFormat, "AdminLevel" , 0);
    Spieler[playerid][AdminLevel] = 0;
    Spieler[playerid][eingeloggt] = 1;
    SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
    }
    }
    }
    else
    {
    switch(dialogid)
    {
    case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
    }
    }


    return 1;
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }



    Die warnings kommen


    C:\Users\Shoxi\Desktop\ Reallife\Login.pwn(182) : warning 217: loose indentation
    C:\Users\Shoxi\Desktop\ Reallife\Login.pwn(342) : warning 225: unreachable code
    C:\Users\Shoxi\Desktop\Reallife\Login.pwn(408) : warning 203: symbol is never used: "Tutorial"
    C:\Users\Shoxi\Desktop\ Reallife\Login.pwn(408) : warning 203: symbol is never used: "gAdmin"
    C:\Users\Shoxi\Desktop\ Reallife\Login.pwn(408) : warning 203: symbol is never used: "pInfo"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Warnings.

  • #include <a_samp>
    #include <dini>



    #define DIALOG_LOGIN 3
    #define DIALOG_REG 4
    #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
    #define COLOR_RED 0xB90000FF
    #define COLOR_YELLOW 0xC3FF00FF
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_BLUE 0x0A00FFFF
    #define GRAD2 0xBFC0C2FF
    #define GRAD5 0xBFC0C2FF
    #define COLOR_LIGHTGREEN 0x9ACD32AA
    #define COLOR_GELB 0xFFFF00FF
    #define COLOR_BLAU 0x0023FFFF


    #define DIALOG_SPAWN 1


    #define COLOR_REDA 0xFF0000FF//ServerOwner
    #define COLOR_LIGHTBLUE 0x33CCFFAA//Administrator
    #define COLOR_LIGHTGREEN 0x9ACD32AA//moderator
    #define COLOR_ORANGERED 0xFF4500AA//superadmin



    enum spieler_daten
    {
    wanted,
    skin,
    Float:lastx,Float:lasty,Float:lastz,
    eingeloggt,
    AdminLevel
    }


    /*
    new gAdmin[MAX_PLAYERS];
    new Tutorial[MAX_PLAYERS]; // Die 3 geben Warnings wenn du sie nicht verwendest.
    new pInfo[MAX_PLAYERS];
    */
    new bsnenter;
    new bsnexit;





    forward tuttimer(playerid);
    forward Score(playerid);



    new Spieler[MAX_PLAYERS][spieler_daten];




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




    public OnGameModeInit()
    {



    bsnenter=CreatePickup(1559,1,1199.1121,-918.1558,43.1241);
    bsnexit=CreatePickup(1559,1,362.9167,-75.2149,1001.5078);


    Create3DTextLabel("BSN\n Eingang",COLOR_BLAU,1199.1121,-918.1558,43.1241,10,0);


    DisableInteriorEnterExits();
    SetGameModeText("Script by Shoxi");
    AddPlayerClass(0,2070.4934,1355.3760,10.6719,153.8582,0,0,0,0,0,0); // Position
    AddPlayerClass(1,2070.4934,1355.3760,10.6719,153.8582,25,200,0,0,0,0); // Position


    AddStaticVehicle(411,1227.7511,-918.4766,42.5119,101.5333,123,1); // Auto1
    AddStaticVehicle(412,1227.1154,-914.8206,42.5121,99.1268,112,1); // Auto2
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid,2070.4934,1355.3760,10.6719); // Position
    SetPlayerFacingAngle(playerid,153.8582);
    SetPlayerCameraPos(playerid,2069.8442,1353.1063,10.6719);
    SetPlayerCameraLookAt(playerid,2070.4934,1355.3760,10.6719);
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    new pname[MAX_PLAYERS],accFormat[128];


    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);


    if(fexist(accFormat))
    {
    ShowPlayerDialog
    (playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    }
    else
    {
    ShowPlayerDialog
    (playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    }


    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {



    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(fexist(accFormat) && Spieler[playerid][eingeloggt])
    {
    dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
    dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
    dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
    dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
    dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
    dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(accFormat,"Score",GetPlayerScore(playerid));
    dini_IntSet(accFormat,"AdminLevel",Spieler[playerid][AdminLevel]);
    }
    Spieler[playerid][eingeloggt] = 0;
    Spieler[playerid][wanted] = 0;
    Spieler[playerid][skin] = 0;
    Spieler[playerid][lastx] = (0.0);
    Spieler[playerid][lasty] = (0.0);
    Spieler[playerid][lastz] = (0.0);
    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 OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext,"/ports",true)==0)
    {
    if (IsPlayerAdmin(playerid))
    ShowPlayerDialog(playerid,DIALOG_SPAWN,DIALOG_STYLE_MSGBOX,"Ports","Wo möchten sie hin?","BSN","LSPD");
    else
    {
    SendClientMessage(playerid, COLOR_BLAU, "Du Bist Kein Admin!");
    }


    return 1;
    }
    return 0;
    }


    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 OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


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


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid==bsnenter)
    {
    SetPlayerPos(playerid,364.4705,-73.7672,1001.5078);
    SetPlayerInterior(playerid,10);
    GameTextForPlayer(playerid,"~b~Du hast den~n~ BSN betreten.",3000,3);
    return 1;
    }
    if(pickupid==bsnexit)
    SetPlayerPos(playerid,1199.2083,-920.9971,43.0283);
    SetPlayerFacingAngle(playerid,187.0484);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,0);
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


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


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {


    if(dialogid==DIALOG_SPAWN)
    {
    if(response==1)
    {
    SetPlayerPos(playerid,1227.1154,-914.8206,42.5121);
    SendClientMessage(playerid,0xFFFF00FF,"Du wurdest zum BSN Teleportiert");
    }
    if(response==0)
    {
    SetPlayerPos(playerid,1542.9987,-1675.6642,13.5556);
    SendClientMessage(playerid,0xFFFF0FF,"Du wurdest zum LSPD Teleportiert");
    }
    }
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(response)
    {
    switch(dialogid) // dialogid auswählen
    {
    case DIALOG_LOGIN: // ID Login
    {
    if(!strlen(inputtext))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
    }
    if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
    {
    Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
    Spieler[playerid][skin] = dini_Int(accFormat,"skin");
    Spieler[playerid][lastx] = dini_Float(accFormat,"lastx");
    Spieler[playerid][lasty] = dini_Float(accFormat,"lasty");
    Spieler[playerid][lastz] = dini_Float(accFormat,"lastz");
    GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
    SetPlayerScore(playerid,dini_Int(accFormat,"Score"));
    Spieler[playerid][AdminLevel] = dini_Int(accFormat, "AdminLevel");
    Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
    SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
    }
    }
    case DIALOG_REG: // ID Registrieren
    {
    if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
    {
    ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
    return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
    }
    dini_Create(accFormat);
    dini_Set(accFormat,"Passwort",inputtext);
    dini_IntSet(accFormat, "AdminLevel" , 0);
    Spieler[playerid][AdminLevel] = 0;
    Spieler[playerid][eingeloggt] = 1;
    SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
    }
    }
    }
    else
    {
    switch(dialogid)
    {
    case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
    }
    }


    return 1;
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }
    Ohne Warnings / Errors.

  • #include <a_samp>
    #include <dini>



    #define DIALOG_LOGIN 3
    #define DIALOG_REG 4
    #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
    #define COLOR_RED 0xB90000FF
    #define COLOR_YELLOW 0xC3FF00FF
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_BLUE 0x0A00FFFF
    #define GRAD2 0xBFC0C2FF
    #define GRAD5 0xBFC0C2FF
    #define COLOR_LIGHTGREEN 0x9ACD32AA
    #define COLOR_GELB 0xFFFF00FF
    #define COLOR_BLAU 0x0023FFFF


    #define DIALOG_SPAWN 1


    #define COLOR_REDA 0xFF0000FF//ServerOwner
    #define COLOR_LIGHTBLUE 0x33CCFFAA//Administrator
    #define COLOR_LIGHTGREEN 0x9ACD32AA//moderator
    #define COLOR_ORANGERED 0xFF4500AA//superadmin



    enum spieler_daten
    {
    wanted,
    skin,
    Float:lastx,Float:lasty,Float:lastz,
    eingeloggt,
    AdminLevel
    }


    /*
    new gAdmin[MAX_PLAYERS];
    new Tutorial[MAX_PLAYERS]; // Die 3 geben Warnings wenn du sie nicht verwendest.
    new pInfo[MAX_PLAYERS];
    */
    new bsnenter;
    new bsnexit;





    forward tuttimer(playerid);
    forward Score(playerid);



    new Spieler[MAX_PLAYERS][spieler_daten];




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




    public OnGameModeInit()
    {



    bsnenter=CreatePickup(1559,1,1199.1121,-918.1558,43.1241);
    bsnexit=CreatePickup(1559,1,362.9167,-75.2149,1001.5078);


    Create3DTextLabel("BSN\n Eingang",COLOR_BLAU,1199.1121,-918.1558,43.1241,10,0);


    DisableInteriorEnterExits();
    SetGameModeText("Script by Shoxi");
    AddPlayerClass(0,2070.4934,1355.3760,10.6719,153.8582,0,0,0,0,0,0); // Position
    AddPlayerClass(1,2070.4934,1355.3760,10.6719,153.8582,25,200,0,0,0,0); // Position


    AddStaticVehicle(411,1227.7511,-918.4766,42.5119,101.5333,123,1); // Auto1
    AddStaticVehicle(412,1227.1154,-914.8206,42.5121,99.1268,112,1); // Auto2
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid,2070.4934,1355.3760,10.6719); // Position
    SetPlayerFacingAngle(playerid,153.8582);
    SetPlayerCameraPos(playerid,2069.8442,1353.1063,10.6719);
    SetPlayerCameraLookAt(playerid,2070.4934,1355.3760,10.6719);
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    new pname[MAX_PLAYERS],accFormat[128];


    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);


    if(fexist(accFormat))
    {
    ShowPlayerDialog
    (playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    }
    else
    {
    ShowPlayerDialog
    (playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    }


    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {



    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(fexist(accFormat) && Spieler[playerid][eingeloggt])
    {
    dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
    dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
    dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
    dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
    dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
    dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(accFormat,"Score",GetPlayerScore(playerid));
    dini_IntSet(accFormat,"AdminLevel",Spieler[playerid][AdminLevel]);
    }
    Spieler[playerid][eingeloggt] = 0;
    Spieler[playerid][wanted] = 0;
    Spieler[playerid][skin] = 0;
    Spieler[playerid][lastx] = (0.0);
    Spieler[playerid][lasty] = (0.0);
    Spieler[playerid][lastz] = (0.0);
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext,"/ports",true)==0)
    {
    if (IsPlayerAdmin(playerid))
    ShowPlayerDialog(playerid,DIALOG_SPAWN,DIALOG_STYLE_MSGBOX,"Ports","Wo möchten sie hin?","BSN","LSPD");
    else
    {
    SendClientMessage(playerid, COLOR_BLAU, "Du Bist Kein Admin!");
    }


    return 1;
    }
    return 0;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid==bsnenter)
    {
    SetPlayerPos(playerid,364.4705,-73.7672,1001.5078);
    SetPlayerInterior(playerid,10);
    GameTextForPlayer(playerid,"~b~Du hast den~n~ BSN betreten.",3000,3);
    return 1;
    }
    if(pickupid==bsnexit)
    SetPlayerPos(playerid,1199.2083,-920.9971,43.0283);
    SetPlayerFacingAngle(playerid,187.0484);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,0);
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {


    if(dialogid==DIALOG_SPAWN)
    {
    if(response==1)
    {
    SetPlayerPos(playerid,1227.1154,-914.8206,42.5121);
    SendClientMessage(playerid,0xFFFF00FF,"Du wurdest zum BSN Teleportiert");
    }
    if(response==0)
    {
    SetPlayerPos(playerid,1542.9987,-1675.6642,13.5556);
    SendClientMessage(playerid,0xFFFF0FF,"Du wurdest zum LSPD Teleportiert");
    }
    }
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(response)
    {
    switch(dialogid) // dialogid auswählen
    {
    case DIALOG_LOGIN: // ID Login
    {
    if(!strlen(inputtext))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
    }
    if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
    {
    Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
    Spieler[playerid][skin] = dini_Int(accFormat,"skin");
    Spieler[playerid][lastx] = dini_Float(accFormat,"lastx");
    Spieler[playerid][lasty] = dini_Float(accFormat,"lasty");
    Spieler[playerid][lastz] = dini_Float(accFormat,"lastz");
    GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
    SetPlayerScore(playerid,dini_Int(accFormat,"Score"));
    Spieler[playerid][AdminLevel] = dini_Int(accFormat, "AdminLevel");
    Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
    SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
    }
    }
    case DIALOG_REG: // ID Registrieren
    {
    if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
    {
    ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
    return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
    }
    dini_Create(accFormat);
    dini_Set(accFormat,"Passwort",inputtext);
    dini_IntSet(accFormat, "AdminLevel" , 0);
    Spieler[playerid][AdminLevel] = 0;
    Spieler[playerid][eingeloggt] = 1;
    SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
    }
    }
    }
    else
    {
    switch(dialogid)
    {
    case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
    case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
    }
    }


    return 1;
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }
    Ohne die ganzen leeren Callbacks^^ ist doch gleich viel übersichtlicher ;)

  • if(Spieler[playerid][AdminLevel] == 0)
    {
    //dein Code
    }