Problem mit Timeban-System

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
  • Ich habe ein Timeban system gescriptet und ich habe jetzt diese Errors aber die gehen nicht weg, habe schon alles ausprobiert.



    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(445) : error 017: undefined symbol "gPlayerName"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(445) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(445) : error 001: expected token: ";", but found "]"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(445) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(445) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.

  • Es soll die erste Zeile sein.



    GetPlayerName(playerid,gPlayerName[playerid],MAX_PLAYER_NAME);
    GetPlayerIp(playerid,gPlayerIp[playerid],16);


    Ich habe das gescriptet.



    ocmd:timeban(playerid,params[])
    {
    if(!isAdmin(playerid,2))return SendClientMessage(playerid,0xFF0000FF,"Du bist kein Admin.");
    new pID,dauer,grund[128];
    if(sscanf(params,"uds[128]",pID,dauer,grund))return SendClientMessage(playerid,0xFFFF00FF,"Info: /timeban[playerid][Dauer[Grund]");
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,0xFFFF00FF,"Der angegebene Spieler existiert nicht oder er ist nicht online!");
    new string[128],string2[128],string3[128];
    format(string,sizeof(string),"%s wurde von %s für %d Minuten gebannt. Grund: %s",pID,SpielerName(playerid),dauer,grund);
    SendClientMessageToAll(0xFF0000FF,string);
    format(string2,sizeof(string2),"Du wurdest vom Admin %s für %d Minuten gebannt. Grund: %s",SpielerName(playerid),dauer,grund);
    format(string3,sizeof(string3),"Du hast %s für %d Minuten vom Server gebannt. Grund: %s",pID,dauer,grund);
    SendClientMessage(pID,0xFF0000FF,string2);
    SendClientMessage(playerid,0xFF0000FF,string3);
    Kick(pID);
    new zeitdauer=Now()+dauer*60;
    timebanplayer(gPlayerName[pID],grund,gPlayerIp[pID],gPlayerName(playerid,zeitdauer);
    return 1;
    }

  • Hatte ich schon, da kam das raus was jz auch raus kam im compiler



    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : error 047: array sizes do not match, or destination array is too small
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : error 001: expected token: ";", but found ")"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.


    So etwas

  • Jetzt habe ich diese Errors



    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : error 047: array sizes do not match, or destination array is too small
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : error 035: argument type mismatch (argument 1)
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2182) : error 017: undefined symbol "timestamp"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2182) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2182 -- 2183) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2183) : error 017: undefined symbol "days_of_month"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2183) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Errors.

  • Zeile 1035: timebanplayer(gPlayerName[pID],grund,gPlayerIp[pID],gPlayerName[playerid],zeitdauer);


    Hier soll es einen Fehler geben



    stock timebanplayer(name[50],grund[128],Ip[20],admin[50],dauer)
    {
    new query[256];
    format(query,sizeof(query),"INSERT INTO timeban (name,grund,Ip,,admin,datum) VALUES ('%s','%s','%s','%s','%d')",name,grund,Ip,admin,dauer);
    mysql_query(query); <-- hier
    mysql_free_result();
    }


    und in diesem teil...



    stock mktime(hour,minute,second,day,month,year)
    {
    new timestamp2;
    timestamp = second + (minute * 60) + hour * (3600),
    new days_of_month[12];

  • stock timebanplayer(name[],grund[],Ip[],admin[],dauer)
    {
    new query[512];
    format(query,sizeof(query),"INSERT INTO timeban (name,grund,Ip,,admin,datum) VALUES ('%s','%s','%s','%s','%d')",name,grund,Ip,admin,dauer);
    mysql_query(handle,query); //handle mit dem ersetzen, wie es bei dir heißt
    return 1;
    }


    stock mktime(hour,minute,second,day,month,year)
    {
    new timestamp2;
    timestamp2 = second + (minute * 60) + hour * (3600);
    new days_of_month[12];

    3HZXdYd.png

    Einmal editiert, zuletzt von Jeffry ()

  • C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(1035) : error 047: array sizes do not match, or destination array is too small
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : error 001: expected token: ";", but found ")"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2174) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Errors.


    Bekomme wieder diese Errors


    Die Zeilen:



    ocmd:timeban(playerid,params[])
    {
    if(!isAdmin(playerid,2))return SendClientMessage(playerid,0xFF0000FF,"Du bist kein Admin.");
    new pID,dauer,grund[128];
    if(sscanf(params,"uds[128]",pID,dauer,grund))return SendClientMessage(playerid,0xFFFF00FF,"Info: /timeban[playerid][Dauer[Grund]");
    if(!IsPlayerConnected(pID))return SendClientMessage(playerid,0xFFFF00FF,"Der angegebene Spieler existiert nicht oder er ist nicht online!");
    new string[128],string2[128],string3[128];
    format(string,sizeof(string),"%s wurde von %s für %d Minuten gebannt. Grund: %s",pID,SpielerName(playerid),dauer,grund);
    SendClientMessageToAll(0xFF0000FF,string);
    format(string2,sizeof(string2),"Du wurdest vom Admin %s für %d Minuten gebannt. Grund: %s",SpielerName(playerid),dauer,grund);
    format(string3,sizeof(string3),"Du hast %s für %d Minuten vom Server gebannt. Grund: %s",pID,dauer,grund);
    SendClientMessage(pID,0xFF0000FF,string2);
    SendClientMessage(playerid,0xFF0000FF,string3);
    Kick(pID);
    new zeitdauer=Now()+dauer*60;
    timebanplayer(gPlayerName[pID],grund,gPlayerIp[pID],gPlayerName[playerid],zeitdauer); //Diese Zeile
    return 1;
    }



    stock timebanplayer(name[50],grund[128],Ip[20],admin[50],dauer)
    {
    new query[256];
    format(query,sizeof(query),"INSERT INTO timeban (name,grund,Ip,,admin,datum) VALUES ('%s','%s','%s','%s','%d')",name,grund,Ip,admin,dauer);
    mysql_query(,dbhandle,query);
    mysql_free_result();
    }

  • Du hast ja die Änderungen auch nicht gemacht.


    So:
    stock timebanplayer(name[],grund[],Ip[],admin[],dauer)
    {
    new query[512];
    format(query,sizeof(query),"INSERT INTO timeban (name,grund,Ip,,admin,datum) VALUES ('%s','%s','%s','%s','%d')",name,grund,Ip,admin,dauer);
    mysql_query(dbhandle,query);
    return 1;
    }

  • So ich habe diese Errors:



    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2182 -- 2183) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2183) : error 017: undefined symbol "days_of_month"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2183) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2183) : error 001: expected token: ";", but found "]"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2183) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.



    Hier irgendwo, ich schicke den ganze stock...



    stock mktime(hour,minute,second,day,month,year)
    {
    new timestamp2;
    timestamp2 = second + (minute * 60) + hour * (3600),
    new days_of_month[12];


    if ( (year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) )
    {
    days_of_month = {31,29,31,30,31,30,31,31,30,31,30,31}
    }
    else
    {
    days_of_month = {31,28,31,30,31,30,31,31,30,31,30,31}
    }
    new days_this_year = 0;
    days_this_year = day;
    if(month > 1)
    {
    for(new i=0; i<month-1;i++)
    {
    days_this_year += days_this_month[i];
    }
    }
    timestamp2 += days_this_year * 86400;

    for(new j=1970;j<year;j++)
    {
    timestamp2 += 31536000;
    if( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp2 += 86400;
    }
    return timestamp2;
    }

  • stock mktime(hour,minute,second,day,month,year)
    {
    new timestamp2;
    timestamp2 = second + (minute * 60) + hour * (3600),
    new days_of_month[12];


    if ( (year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) )
    {
    days_of_month = {31,29,31,30,31,30,31,31,30,31,30,31}
    }
    else
    {
    days_of_month = {31,28,31,30,31,30,31,31,30,31,30,31}
    }
    new days_this_year = 0;
    days_this_year = day;
    if(month > 1)
    {
    for(new i=0; i<month-1;i++)
    {
    days_this_year += days_this_month;
    }
    }
    timestamp2 += days_this_year * 86400;


    for(new j=1970;j<year;j++)
    {
    timestamp2 += 31536000;
    if( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp2 += 86400;
    }
    return timestamp2;
    }

  • Jetzt kommen diese Errors...



    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2185) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2185) : warning 215: expression has no effect
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2185) : error 001: expected token: ";", but found ")"
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2185) : error 029: invalid expression, assumed zero
    C:\Users\ante valentic\Desktop\SAMP SERVER\gamemodes\Reallife.pwn(2185) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.

  • stock mktime(hour,minute,second,day,month,year)
    {
    new timestamp2;
    timestamp2 = second + (minute * 60) + hour * (3600);
    new days_of_month[12];


    if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) )
    {
    days_of_month = { 31,29,31,30,31,30,31,31,30,31,30,31 };
    }
    else
    {
    days_of_month = { 31,28,31,30,31,30,31,31,30,31,30,31 };
    }
    new days_this_year = 0;
    days_this_year = day;
    if(month > 1)
    {
    for(new i=0; i<month-1;i++)
    {
    days_this_year += days_of_month[i];
    }
    }
    timestamp2 += days_this_year * 86400;


    for(new j=1970;j<year;j++)
    {
    timestamp2 += 31536000;
    if( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp2 += 86400;
    }
    return timestamp2;
    }