Wantedsystem wie im SP

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
  • Hey Hey
    Ich wollte mal fragen, ob es im GF möglich ist,
    das Wanted system durch das im SP zu ersetzen?
    Sprich ein Cop macht /su 24 Flucht und Spieler 24 Bekommt einen "Stern" und die Meldung


    Du hast ein Verbrechen begangen:
    Flucht

  • jo irgendwie scheiße das auf Themen keinerlei passende Antwort kommt und Wochenlang wenn nicht Monate oder gar nicht beantwortet werden. Könnte mal einer die Lösung schreiben oder ist dies garnicht möglich (das man im hud die wanteds sieht)?


    Lg
    Michi

  • su command:
    //----------------------------------[SetCrim]-----------------------------------------------


    setcriminal, schon vorhanden, hiermit ersetzen:


    synchro wanteds, neue Funktion, Forward nicht vergessen:

    Code
    public SynchroWanteds(playerid)
    {
    new Playerwanteds;
    Playerwanteds = GetPlayerWantedLevel(playerid);
    SetPlayerWantedLevel(playerid, WantedLevel[playerid]);
    
    
    return 1;
    }


    getestet und funktioniert.


    Problem mit dem wantedsverlieren:
    nach production suchen und hiermit ersetzen:

    ICQ Scripting - Support 495961653
    Montags-Freitags ab 15 Uhr

  • lol ist ja geil xD


    habe alles eingesetzt
    (8329) : warning 217: loose indentation
    (8940) : warning 217: loose indentation
    (10617) : warning 217: loose indentation
    (10671) : warning 217: loose indentation
    (10671) : warning 202: number of arguments does not match definition
    (10697) : warning 217: loose indentation
    (26766) : error 025: function heading differs from prototype
    (26769) : warning 204: symbol is assigned a value that is never used: "Playerwanteds"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Error.


    forward SynchroWanteds();


    //----------------------------------[SetCrim]-----------------------------------------------
    if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Dienst!");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Schreibweise: (/su)spect [playerid/PartOfName] [crime discription]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if (gTeam[giveplayerid] != 2)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];


    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Schreibweise: (/su)spect [playerid/PartOfName] [Grund]");
    return 1;
    }
    if (WantedLevel[giveplayerid] >= 6 )
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Spieler hat schon 6 Wanteds!");
    return 1;
    }
    if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
    else
    {
    WantedPoints[giveplayerid]+= 2;
    SynchroWanteds(playerid);
    }
    SetPlayerCriminal(giveplayerid,playerid, result);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You can't suspect a Cop !");
    }
    }
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist kein Cop/FBI/Nation Guard/MIB!");
    }
    }
    return 1;
    }


    public SetPlayerCriminal(playerid,declare,reason[])
    {//example: SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
    if(IsPlayerConnected(playerid))
    {
    PlayerInfo[playerid][pCrimes] += 1;
    new points = WantedPoints[playerid];
    new turned[MAX_PLAYER_NAME];
    new turner[MAX_PLAYER_NAME];
    new turnmes[128];
    new wantedmes[128];
    new wlevel;
    new Wanteds;
    Wanteds = GetPlayerWantedLevel(playerid);
    strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
    GetPlayerName(playerid, turned, sizeof(turned));
    if (declare == 255)
    {
    format(turner, sizeof(turner), "Unknown");
    strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
    }
    else
    {
    if(IsPlayerConnected(declare))
    {
    GetPlayerName(declare, turner, sizeof(turner));
    strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
    strmid(PlayerCrime[declare][pBplayer], turned, 0, strlen(turned), 255);
    strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
    }
    }
    format(turnmes, sizeof(turnmes), "Du hast ein Verbrechen begangen ( %s ). Reporter: %s.",reason,turner);
    SendClientMessage(playerid, COLOR_LIGHTRED, turnmes);
    if(points > 0)
    {
    new yesno;
    if(points == 3) { if(WantedLevel[playerid] != 1) {if(Wanteds !=1) { WantedLevel[playerid] = 1;SetPlayerWantedLevel(playerid, 1); wlevel = 1; yesno = 1; } }}
    else if(points >= 4 && points <= 5) { if(WantedLevel[playerid] != 2) {if(Wanteds !=2) { WantedLevel[playerid] = 2; SetPlayerWantedLevel(playerid, 2); wlevel = 2; yesno = 1; } }}
    else if(points >= 6 && points <= 7) { if(WantedLevel[playerid] != 3) {if(Wanteds !=3){ WantedLevel[playerid] = 3;SetPlayerWantedLevel(playerid, 3); wlevel = 3; yesno = 1; } }}
    else if(points >= 8 && points <= 9) { if(WantedLevel[playerid] != 4){if(Wanteds !=4) { WantedLevel[playerid] = 4; SetPlayerWantedLevel(playerid, 4);wlevel = 4; yesno = 1; } }}
    else if(points >= 10 && points <= 11) { if(WantedLevel[playerid] != 5) {if(Wanteds !=5){ WantedLevel[playerid] = 5;SetPlayerWantedLevel(playerid, 5); wlevel = 5; yesno = 1; } }}
    else if(points >= 12 && points <= 13) { if(WantedLevel[playerid] != 6) {if(Wanteds !=6){ WantedLevel[playerid] = 6; SetPlayerWantedLevel(playerid, 6);wlevel = 6; yesno = 1; } }}
    if(WantedLevel[playerid] >= 1) { if(gTeam[playerid] == 3) { gTeam[playerid] = 4; } }
    if(yesno)
    {
    format(wantedmes, sizeof(wantedmes), "Momentanes Gesuchten Stufe: %d", wlevel);
    SendClientMessage(playerid, COLOR_YELLOW, wantedmes);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pMember] == 1||PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pLeader] == 2 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 3 || PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pLeader] == 14 || PlayerInfo[i][pMember] == 14)
    {
    format(cbjstore, sizeof(turnmes), "Funk: An alle Einheiten: Reporter: %s",turner);
    SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
    format(cbjstore, sizeof(turnmes), "Funk: Verbrechen: %s, Gesuchter: %s",reason,turned);
    SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
    }
    }
    }
    }
    }
    }//not connected
    }


    public SynchroWanteds(playerid)
    {
    new Playerwanteds;
    Playerwanteds = GetPlayerWantedLevel(playerid);
    SetPlayerWantedLevel(playerid, WantedLevel[playerid]);


    return 1;
    }


    public Production()
    {
    //new string[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pFishes] >= 5) { if(FishCount[i] >= 3) { PlayerInfo[i][pFishes] = 0; } else { FishCount[i] += 1; } }
    if(PlayerDrunk[i] > 0) { PlayerDrunk[i] = 0; PlayerDrunkTime[i] = 0; GameTextForPlayer(i, "~p~Drunk effect~n~~w~Gone", 3500, 1); }
    if(PlayerInfo[i][pPayDay] < 6) { PlayerInfo[i][pPayDay] += 1; } //+ 5 min to PayDay anti-abuse
    for(new k = 0; k < MAX_PLAYERS; k++)
    {
    if(IsPlayerConnected(k))
    {
    if(gTeam[k] == 2 && CrimInRange(80.0, i,k))
    {
    }
    else
    {
    /* WantedPoints[i] -= 3;
    if(WantedPoints[i] < 0) { WantedPoints[i] = 0; }
    new points = WantedPoints[i];
    new wlevel;
    if(points > 0)
    {
    new yesno;
    if(points == 3) { if(WantedLevel[i] != 1) { WantedLevel[i] = 1; wlevel = 1; yesno = 1; } }
    else if(points >= 4 && points <= 5) { if(WantedLevel[i] != 2) { WantedLevel[i] = 2; wlevel = 2; yesno = 1; } }
    else if(points >= 6 && points <= 7) { if(WantedLevel[i] != 3) { WantedLevel[i] = 3; wlevel = 3; yesno = 1; } }
    else if(points >= 8 && points <= 9) { if(WantedLevel[i] != 4) { WantedLevel[i] = 4; wlevel = 4; yesno = 1; } }
    else if(points >= 10 && points <= 11) { if(WantedLevel[i] != 5) { WantedLevel[i] = 5; wlevel = 5; yesno = 1; } }
    else if(points >= 12 && points <= 13) { if(WantedLevel[i] != 6) { WantedLevel[i] = 6; wlevel = 6; yesno = 1; } }
    else if(points <= 0) { if(WantedLevel[i] != 0) { ClearCrime(i); WantedLevel[i] = 0; wlevel = 0; yesno = 1;} }
    if(yesno)


    {
    format(string, sizeof(string), "Current Wanted Level: %d", wlevel);
    SendClientMessage(i, COLOR_YELLOW, string);
    }
    } */
    }
    }
    }
    }
    }
    }


    habe also alles so eingefügt. Wo liegt der fehler?

  • okay habe ich


    (10672) : warning 202: number of arguments does not match definition
    (26767) : error 025: function heading differs from prototype
    (26770) : warning 204: symbol is assigned a value that is never used: "Playerwanteds"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Error.



    Falls das was hilft:
    Zeile 10672
    SynchroWanteds(playerid);


    Zeile 26767
    public SynchroWanteds(playerid)


    Zeile 26770
    Playerwanteds = GetPlayerWantedLevel(playerid);


    Lg
    michi

  • owe das wird immer schlimmer xD

    (10672) : error 004: function "SynchroWanteds" is not implemented
    (26767) : error 025: function heading differs from prototype
    (26768) : error 055: start of function body without function header
    (26770) : error 010: invalid function or declaration
    (26773) : error 010: invalid function or declaration
    (26925) : warning 203: symbol is never used: "Playerwanteds"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Errors.


    Zeile 10672:
    SynchroWanteds(playerid);


    Zeile 26767
    public SynchroWanteds(playerid);


    Zeile 26768
    {


    Zeile 26770
    Playerwanteds = GetPlayerWantedLevel(playerid);


    Zeile 26773
    return 1;


    und nu der Hammer Zeile 26925 gibts bei mir gernicht xD


    glaube mal das ; gehört da doch net hin^^

  • Wenn man es richtig machen würde, käme weder ein Warn noch ein Error. Wie soll ich das dann wohl erfolgreich getestet haben..


    Also, mach nochmal die falschen (leider) Vorschläge rückgängig. Dann nocheinmal RICHTIG forwarden ( forward SynchroWanteds(playerid);)), sodass kein error übrig bleibt, und es compilt werden kann. Dann NUR die Zeile mit dem Warn posten, ich kann ja wohl schwer erratet, welche die Zeile "10672" bei dir ist von den ~100 Zeilen.

    ICQ Scripting - Support 495961653
    Montags-Freitags ab 15 Uhr

  • sieht schonmal besser aus nur ne menga warnings noch ;(


    (8329) : warning 217: loose indentation
    8940) : warning 217: loose indentation
    (10617) : warning 217: loose indentation
    (10671) : warning 217: loose indentation
    (10697) : warning 217: loose indentation
    (26769) : warning 204: symbol is assigned a value that is never used: "Playerwanteds"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    Header size: 6360 bytes
    Code size: 1136456 bytes
    Data size: 2212748 bytes
    Stack/heap size: 16384 bytes; estimated max. usage=4648 cells (18592 bytes)
    Total requirements: 3371948 bytes


    6 Warnings.


    (8329) : if(strcmp(cmd, "/open", true) == 0)//pdgate
    (8940) : if (strcmp(cmd, "/number", true) == 0)
    (10617) : if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
    (10671) : SynchroWanteds(playerid);
    (10697) : if(strcmp(cmd, "/lock", true) == 0)
    (26769) :Playerwanteds = GetPlayerWantedLevel(playerid);

  • (26769) : warning 204: symbol is assigned a value that is never used: "Playerwanteds"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    Header size: 6360 bytes
    Code size: 1136456 bytes
    Data size: 2212748 bytes
    Stack/heap size: 16384 bytes; estimated max. usage=4648 cells (18592 bytes)
    Total requirements: 3371948 bytes


    1 Warning.


    ah kann es sein das das irgenwie die anderen warnings unterbindet? oder was bewirkt das?


    Nun muss nurnoch der letzte warning weg dann sollte es ja gehn =)



    Lg
    Michi

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen