komische Fehler

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
  • habe mir ein Admin/register/login system runtergeladen und versucht ins script zu hauen:


    // [Fun4Life] Reallife
    //Created by Meisternuke and Powernuke


    #include <a_samp>
    #include <dini>
    #include <core>
    #include <float>
    #include <time>
    #include <file>
    #include <morphinc>
    #include <MidoStream>


    #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


    #pragma tabsize 0


    new UpdateTimer;
    new SpielerInfo[MAX_PLAYERS][sInfo];
    new Eingeloggt[MAX_PLAYERS];
    new Team[MAX_PLAYERS];


    #define blue 0x375FFFFF
    #define red 0xFF0000AA
    #define green 0x33FF33AA
    #define yellow 0xFFFF00AA
    #define grey 0xC0C0C0AA
    #define blue1 0x2641FEAA
    #define lightblue 0x33CCFFAA
    #define orange 0xFF9900AA
    #define black 0x2C2727AA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_BLUE 0x0000BBAA
    #define COLOR_PURPLE 0x800080AA
    #define COLOR_BLACK 0x000000AA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_GREEN1 0x33AA33AA
    #define COLOR_BROWN 0xA52A2AAA
    #define COLOR_GREY 0xAFAFAFAA
    #define Grau 0x00FF00FF
    #define rot 0xAA3333AA
    #define COLOR_LIGHTRED 0xFF6347AA
    #define hellblau 0x33CCFFAA
    #define COLOR_LIGHTGREEN 0x9ACD32AA
    #define COLOR_YELLOW 0xDABB3EAA
    #define Gelb 0xDABB3EAA
    #define COLOR_WHITE 0xFFFFFFAA
    #define blau 0x2641FEAA




    #define LEVEL1
    #define LEVEL2
    #define LEVEL3
    #define LEVEL4
    #define LEVEL5
    #define KEINADMIN
    #define KEINADMIN1
    #define KEINADMIN2
    #define KEINADMIN3
    #define KEINADMIN4
    #define KEINADMIN5


    enum sInfo
    {
    score,
    cash,
    admin,
    team,
    }



    public OnGameModeInit()
    {
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    new string[256];
    new Spieler[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Spieler, sizeof(Spieler));
    format(string, sizeof(string), "%s.sav", Spieler);
    Eingeloggt[playerid] = 0;
    SendClientMessage(playerid, rot, " Willkommen auf dem Server.");
    if (dini_Exists(string)) {
    SendClientMessage(playerid, rot, " Bitte logge dich ein: /login [Password]");
    }else{
    SendClientMessage(playerid, rot, " Bitte registriere dich: /register [Password]"); }
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    new string[256];
    new Spieler[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Spieler, sizeof(Spieler));
    format(string, sizeof(string), "%s.gameradmin", Spieler);
    dini_IntSet(string, "score", GetPlayerScore(playerid));
    dini_IntSet(string, "cash", GetPlayerMoney(playerid));
    dini_IntSet(string, "admin", SpielerInfo[playerid][admin]);
    dini_IntSet(string, "team", GetPlayerTeam(playerid));
    Eingeloggt[playerid] = 0;
    KillTimer(UpdateTimer);
    MidoStreamDisconnect(playerid);
    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[])
    {
    dcmd(ahelp,5,cmdtext);
    //----------------------------
    dcmd(mgadmin,7,cmdtext);
    //----------------------------
    dcmd(register,8,cmdtext);
    dcmd(login,5,cmdtext);
    dcmd(admins,6,cmdtext);
    //----------------------------
    dcmd(kick,4,cmdtext);
    dcmd(ban,3,cmdtext);
    dcmd(healall,7,cmdtext);
    dcmd(healme,4,cmdtext);
    dcmd(killall,7,cmdtext);
    dcmd(kickall,7,cmdtext);
    dcmd(goto,4,cmdtext);
    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)
    {
    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;
    }
    dcmd_kickall(playerid,params[])
    {
    #pragma unused params
    if(SpielerInfo[playerid][admin]>=5 || IsPlayerAdmin(playerid)) {
    SendClientMessageToAll(rot,"Alle wurden vom Server gekickt.");
    for(new i =0; i < MAX_PLAYERS;i++) {
    Kick(i);
    }
    }
    else {
    SendClientMessage(playerid,rot,KEINADMIN);//thx an Goldkiller
    return 1;
    }
    return 1;
    }


    dcmd_admins(playerid,params[])
    {
    #pragma unused params
    SendClientMessage(playerid, rot, "***Admins Online:");
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) {
    if(SpielerInfo[i][admin] > 0|| IsPlayerAdmin(i)) {
    GetPlayerName(i, sendername, sizeof(sendername));
    format(string, 128, " %s (Level:%d)", sendername,SpielerInfo[i][admin]);
    SendClientMessage(playerid, rot, string);
    }}}
    return 1;
    }


    dcmd_goto(playerid,params[]) {
    if(SpielerInfo[playerid][admin]>=1 || IsPlayerAdmin(playerid)) {
    new typ = strval(strget(params, 1));
    if(IsPlayerConnected(typ)) {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(typ,x,y,z);
    SetPlayerPos(playerid,x,y,z);
    SetPlayerInterior(playerid,GetPlayerInterior(typ));
    }else{
    SendClientMessage(playerid,rot,"ID nicht vergeben"); }
    return 1;}
    else { SendClientMessage(playerid,rot,KEINADMIN);}
    return 1;}



    dcmd_healme(playerid,params[]) {
    #pragma unused params
    if(SpielerInfo[playerid][admin]>=1 || IsPlayerAdmin(playerid)) {
    SetPlayerHealth(playerid,100);}
    else { SendClientMessage(playerid,rot,KEINADMIN);}
    return 1;}



    dcmd_healall(playerid,params[]) {
    new string[128];
    #pragma unused params
    if(SpielerInfo[playerid][admin]>=2 || IsPlayerAdmin(playerid)) {
    for(new i = 0; i <= MAX_PLAYERS; i++) {
    SetPlayerHealth(i,100);}
    new Text[32];
    new SpielerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,SpielerName,sizeof(SpielerName));
    format(Text,sizeof(Text),"%s hat alle geheilt!",SpielerName);
    SendClientMessageToAll(rot,Text);
    format(string,sizeof(string),"Admin: %s Hat alle geheilt!",admin);}
    else { SendClientMessage(playerid,rot,KEINADMIN);}
    return 1;}


    dcmd_killall(playerid,params[]) {
    new string[128];
    #pragma unused params
    if(SpielerInfo[playerid][admin]>=4 || IsPlayerAdmin(playerid)) {
    for(new i = 0; i <= MAX_PLAYERS; i++) {
    SetPlayerHealth(i,0);}
    new Text[32];
    SendClientMessageToAll(rot,Text);
    format(string,sizeof(string),"Admin: %s Hat alle gekillt!",admin);}
    else { SendClientMessage(playerid,rot,KEINADMIN);}
    return 1;}


    dcmd_ahelp(playerid,params[]) {
    #pragma unused params
    if(SpielerInfo[playerid][admin]>=1 || IsPlayerAdmin(playerid)) {
    SendClientMessage(playerid,blau,LEVEL1);}
    else { SendClientMessage(playerid,rot,KEINADMIN1);}
    if(SpielerInfo[playerid][admin]>=2 || IsPlayerAdmin(playerid)) {
    SendClientMessage(playerid,blau,LEVEL2);}
    else { SendClientMessage(playerid,rot,KEINADMIN2);}
    if(SpielerInfo[playerid][admin]>=3 || IsPlayerAdmin(playerid)) {
    SendClientMessage(playerid,blau,LEVEL3);}
    else { SendClientMessage(playerid,rot,KEINADMIN3);}
    if(SpielerInfo[playerid][admin]>=4 || IsPlayerAdmin(playerid)) {
    SendClientMessage(playerid,blau,LEVEL4);}
    else { SendClientMessage(playerid,rot,KEINADMIN4);}
    if(SpielerInfo[playerid][admin]>=5 || IsPlayerAdmin(playerid)) {
    SendClientMessage(playerid,blau,LEVEL5);}
    else { SendClientMessage(playerid,rot,KEINADMIN5);}
    return 1;}


    dcmd_kick(playerid,params[]) {//by tut
    if(SpielerInfo[playerid][admin]>=2 || IsPlayerAdmin(playerid)) {
    new
    sGrund[128],
    pID;
    if(sscanf(params, "dz",pID,sGrund)) {
    return SendClientMessage(playerid,rot,"USAGE: /kick [playerid] ([grund],optional)");
    }
    if(!IsPlayerConnected(pID)) {
    return SendClientMessage(playerid,rot,"Kein Spieler mit angegebener ID Online");
    }
    new
    ThePlayer[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(pID,ThePlayer,sizeof(ThePlayer));
    format(string,sizeof(string),"%s (ID %d) wurde vom Server gekickt,Grund: %s",ThePlayer,pID,sGrund[0] ? sGrund : "<Kein Grund>");
    SendClientMessageToAll(COLOR_YELLOW,string);
    Kick(pID);
    } else { SendClientMessage(playerid,rot,KEINADMIN); }
    return 1;
    }


    dcmd_ban(playerid,params[]) {// by tut
    if(SpielerInfo[playerid][admin]>=3 || IsPlayerAdmin(playerid)) {
    new
    sGrund[128],
    pID;
    if(sscanf(params, "dz",pID,sGrund)) {
    return SendClientMessage(playerid,rot,"USAGE: /ban [playerid] ([grund],optional)");
    }
    if(!IsPlayerConnected(pID)) {
    return SendClientMessage(playerid,rot,"Kein Spieler mit angegebener ID Online");
    }
    new
    ThePlayer[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(pID,ThePlayer,sizeof(ThePlayer));
    format(string,sizeof(string),"%s (ID %d) wurde vom Server gebant,Grund: %s",ThePlayer,pID,sGrund[0] ? sGrund : "<Kein Grund>");
    SendClientMessageToAll(COLOR_YELLOW,string);
    Ban(pID);
    } else { SendClientMessage(playerid,rot,KEINADMIN); }
    return 1;
    }

    bitte jemand ein topic erstellen damit ich fortsetzten kann

    Pessimisten sind Optimisten mit Erfahrung!

    Einmal editiert, zuletzt von Meisternuke ()


  • dcmd_mgadmin(playerid,params[]) {
    if(SpielerInfo[playerid][admin]>=5 || IsPlayerAdmin(playerid)) {
    if(!strlen(params)) return SendClientMessage(playerid,rot,"/mgadmin ID LEVEL");
    new typ = strval(strget(params,0));
    if(IsPlayerConnected(typ)) {
    if(!strlen(strget(params,1))) return SendClientMessage(playerid,rot,"/mgadmin ID LEVEL");
    new adminlvl = strval(strget(params,1));
    if(adminlvl>=0 && adminlvl<=5) {
    new s[100], name[16];
    GetPlayerName(typ,name,sizeof(name));
    format(s,sizeof(s),"Du hast %s zum Admin Level %d gemacht",name,adminlvl);
    SendClientMessage(playerid,blau,s);
    GetPlayerName(playerid,name,sizeof(name));
    format(s,sizeof(s),"%s hat dich zum Admin Level %d gemacht",name,adminlvl);
    SendClientMessage(typ,blau,s); SpielerInfo[typ][admin] = adminlvl; }
    else { SendClientMessage(playerid,rot,"Inkorrektes Level"); }}
    else { SendClientMessage(playerid,rot,"ID nicht vergeben"); }}
    else { SendClientMessage(playerid,rot,"Dein Admin Level ist nich hoch genung"); }
    return 1;
    }


    dcmd_register(playerid, params[])
    {
    if (IsPlayerConnected(playerid)){
    new string[21];
    new Spieler[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Spieler, sizeof(Spieler));
    format(string, sizeof(string), "%s.gameradmin", Spieler);
    if(!strlen(params)){
    return SendClientMessage(playerid, 0xffffff, " /register [Password]");
    }
    if (dini_Exists(string))
    {
    return SendClientMessage(playerid, 0xffffff, " Der name ist bereits registriert");
    }
    else
    {
    dini_Create(string);
    dini_IntSet(string, "password",udb_hash(params));
    dini_IntSet(string, "score", 0);
    dini_IntSet(string, "cash", 0);
    dini_IntSet(string, "admin", 0);
    dini_IntSet(string, "team", 0);
    SendClientMessage(playerid, 0xffffff, " Bitte einloggen: /login [Password]");
    }
    }
    return 1;
    }


    dcmd_login(playerid, params[])
    {
    if (IsPlayerConnected(playerid))
    {
    new string[21];
    new Spieler[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Spieler, sizeof(Spieler));
    format(string, sizeof(string), "%s.gameradmin", Spieler);
    if(!strlen(params))
    {
    return SendClientMessage(playerid, 0xffffff, " /register [Password]");
    }
    if (dini_Exists(string))
    {
    if(udb_hash(params)!=strval(dini_Get(string,"password")))
    {
    return SendClientMessage(playerid, 0xffffff, " Falsches password");
    }
    Eingeloggt[playerid] = 1;
    SpielerInfo[playerid][score] = dini_Int(string, "score");
    SpielerInfo[playerid][cash] = dini_Int(string, "cash");
    SpielerInfo[playerid][admin] = dini_Int(string, "admin");
    Team[playerid] = dini_Int(string, "team");
    ResetPlayerMoney(playerid);
    SetPlayerScore(playerid,0);
    GivePlayerMoney(playerid, SpielerInfo[playerid][cash]);
    SetPlayerScore(playerid, SpielerInfo[playerid][score])
    ; SendClientMessage(playerid,0xffffff,"Erfolgreich eingeloggt");
    }
    }
    return 1;
    }


    stock sscanf(string[], format[], {Float,_}:...)
    {


    #if defined isnull
    if (isnull(string))
    #else
    if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
    #endif
    {
    return format[0]; }
    #pragma tabsize 4
    new
    formatPos = 0,
    stringPos = 0,
    paramPos = 2,
    paramCount = numargs(),
    delim = ' ';
    while (string[stringPos] && string[stringPos] <= ' ') {
    stringPos++; }
    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 ('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
    num = 0,
    ch = string[stringPos];
    #pragma tabsize 0
    do {
    stringPos++;
    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 = string[stringPos]) > ' ' && ch != delim);
    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 '\'': {
    new
    end = formatPos - 1,
    ch;
    while ((ch = format[++end]) && ch != '\'') {}
    if (!ch) {
    return -1; }
    format[end] = '\0';
    if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1) {
    if (format[end + 1]) {
    return -1; }
    return 0; }
    format[end] = '\'';
    stringPos = ch + (end - formatPos);
    formatPos = end + 1; }
    case 'u': {
    new
    end = stringPos - 1,
    id = 0,
    bool:num = true,
    ch;
    while ((ch = string[++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
    string[end] = '\0';
    num = false;
    new
    name[MAX_PLAYER_NAME];
    id = end - stringPos;
    foreach (Player, playerid) {
    GetPlayerName(playerid, name, sizeof (name));
    if (!strcmp(name, string[stringPos], true, id)) {
    setarg(paramPos, 0, playerid);
    num = true;
    break; }}
    if (!num){
    setarg(paramPos, 0, INVALID_PLAYER_ID);}
    string[end] = ch;
    #if defined __SSCANF_FOREACH__
    #undef foreach
    #undef __SSCANF_FOREACH__
    #endif
    }
    stringPos = end; }
    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: {


    #pragma tabsize 0
    continue; } }
    while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ') {
    stringPos++; }
    while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' ')) {
    stringPos++; }
    paramPos++; }
    do
    {
    if ((delim = format[formatPos++]) > ' '){
    if (delim == '\''){
    while ((delim = format[formatPos++]) && delim != '\'') {}}
    else if (delim != 'z'){
    return delim;}}}
    while (delim > ' ');
    return 0;}


    stock strget(strx[], pos, search = ' ') {
    new arg, ret[128], idxx;
    for (new i = 0; i < strlen(strx); i++) {
    if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
    arg++;
    if (arg == pos + 1){
    ret[i-idxx] = EOS;
    return ret;
    } else if (arg == pos)
    idxx= i+1;
    }
    else if (arg == pos)
    ret[i - idxx] = strx[i];
    }
    return ret;
    }
    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[])
    {
    return 1;
    }


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


    ich bekomme beim compilen folgende errors:



    was ist falsch?


    nicht wundern habe mal alles aus dem eigentlichen gamemode wie spawn usw raus

    Pessimisten sind Optimisten mit Erfahrung!