Wanted bug

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 leute,


    ich hab nen wanted bug.


    Unzwar bekommen spieler bei /su garnicht immer ihre wanteds....
    Ich weiß nicht woran es liegt...
    vllt hierran


    if(WantedPoints[playerid] == 1) { if(WantedLevel[playerid] != 1) { WantedLevel[playerid] = 1; } }
    else if(WantedPoints[playerid] >= 2 && WantedPoints[playerid] <= 2) { if(WantedLevel[playerid] != 2) { WantedLevel[playerid] = 2; } }
    else if(WantedPoints[playerid] >= 3 && WantedPoints[playerid] <= 3) { if(WantedLevel[playerid] != 3) { WantedLevel[playerid] = 3; } }
    else if(WantedPoints[playerid] >= 4 && WantedPoints[playerid] <= 4) { if(WantedLevel[playerid] != 4) { WantedLevel[playerid] = 4; } }
    else if(WantedPoints[playerid] >= 5 && WantedPoints[playerid] <= 5) { if(WantedLevel[playerid] != 5) { WantedLevel[playerid] = 5; } }
    else if(WantedPoints[playerid] >= 6 && WantedPoints[playerid] <= 6) { if(WantedLevel[playerid] != 6) { WantedLevel[playerid] = 6; } }
    else if(WantedPoints[playerid] >= 10) { if(WantedLevel[playerid] != 10) { WantedLevel[playerid] = 10; } }
    SetPlayerWantedLevel(playerid,WantedLevel[playerid]);


    ansonsten wenns net daran liegt, sagt mal bitte, was ihr braucht

  • //----------------------------------[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, "HILFE: (/su)spect [playerid/PartOfName] [crime discription]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (gTeam[playerid] == 2 || IsACop(playerid))
    {
    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, "HILFE: (/su)spect [playerid/PartOfName] [crime text]");
    return 1;
    }
    if(WantedLevel[giveplayerid] == 0) { WantedLevel[giveplayerid] == 1; }
    else { WantedLevel[giveplayerid]+= 1; }
    SetPlayerCriminal(giveplayerid,playerid, result);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du kannst einem Polizist keine wanteds geben.");
    }
    }
    }
    else
    {
    format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You are not a Cop / FBI / National Guard !");
    }
    }
    return 1;
    }


    pro su, soll ja immer 1wanted mehr,
    also
    /su 0 haha z.B.
    = 1wanted
    su 0 haha
    = 2wanted
    immermehr halt, pro /su ID Grund = 1wanted

  • //----------------------------------[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, "HILFE: (/su)spect [playerid/PartOfName] [crime discription]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (gTeam[playerid] == 2 || IsACop(playerid))
    {
    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, "HILFE: (/su)spect [playerid/PartOfName] [crime text]");
    return 1;
    }
    if(WantedLevel[giveplayerid] == 0) { WantedLevel[giveplayerid] == 1; }
    else { WantedLevel[giveplayerid]+= 1; }
    SetPlayerCriminal(giveplayerid,playerid, result);
    WantedLevel[giveplayerid]++;
    SetPlayerWantedLevel(giveplayerid,WantedLevel[giveplayerid]);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du kannst einem Polizist keine wanteds geben.");
    }
    }
    }
    else
    {
    format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You are not a Cop / FBI / National Guard !");
    }
    }
    return 1;
    }


    Versuch des mal so

  • hmm,
    so ganz klappt das nicht.
    Sterne kommt einer beim ersten /su
    aber trotzdem steth dort wantedlevel 0


    bei 2. wenn ich /su mache
    steht dort wantedlevel 0, passiert weiter nix


    später paar mehr, irgendwann steht dort wantedlevel 2
    und paar sterne 3 oder so



    habs paar mal gemacht bis sterne voll waren
    troztdem stand in /stats 0 wantedlevel

  • new married[20];
    strmid(married, PlayerInfo[targetid][pMarriedTo], 0, strlen(PlayerInfo[targetid][pMarriedTo]), 255);
    new age = PlayerInfo[targetid][pAge];
    new takeover = takeovers[playerid];
    new ptime = PlayerInfo[targetid][pConnectTime];
    new lotto = PlayerInfo[targetid][pLottoNr];
    new deaths = PlayerInfo[targetid][pDeaths];
    new fishes = PlayerInfo[targetid][pFishes];
    new bigfish = PlayerInfo[targetid][pBiggestFish];
    new crimes = PlayerInfo[targetid][pCrimes];
    new arrests = PlayerInfo[targetid][pArrested];
    new warrests = PlayerInfo[targetid][pWantedDeaths];
    new pot = PlayerInfo[targetid][pPot];
    new crack = PlayerInfo[targetid][pCrack];
    new mats = PlayerInfo[targetid][pMats];
    new wanted = WantedLevel[targetid];
    new level = PlayerInfo[targetid][pLevel];
    new exp = PlayerInfo[targetid][pExp];
    new kills = PlayerInfo[targetid][pKills];
    new pnumber = PlayerInfo[targetid][pPnumber];
    new account = PlayerInfo[targetid][pAccount];
    new nxtlevel = PlayerInfo[targetid][pLevel]+1;
    new expamount = nxtlevel*levelexp;
    new costlevel = nxtlevel*levelcost;//10k for testing purposes
    new housekey = PlayerInfo[targetid][pPhousekey];
    new bizkey = PlayerInfo[targetid][pPbiskey];
    new intir = PlayerInfo[targetid][pInt];
    new local = PlayerInfo[targetid][pLocal];
    new Float:shealth = PlayerInfo[targetid][pSHealth];
    new Float:health;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(targetid, name, sizeof(name));
    GetPlayerHealth(targetid,health);
    new Float:px,Float:py,Float:pz;
    GetPlayerPos(targetid, px, py, pz);
    new coordsstring[256];
    // SendClientMessage(playerid, COLOR_LIGHTGREEN,"______________________>>> Statistik von %s <<<______________________",name);
    format(coordsstring, sizeof(coordsstring),"______________________>>> Statistik von %s <<<______________________",name);
    SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Level:[%d] Geschlecht:[%s] Alter:[%d] Origin:[%s] SpawnHealth:[%.1f] Bar:[$%d] Bank:[$%d] Ph:[%d]", level,atext,age,otext,shealth+50, cash, account, pnumber);
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "DonateRank:[%s] MarriedTo:[%s] PlayingHours:[%d] LottoNr:[%d] Job:[%s] Takeovers:[%d]", drank,married,ptime,lotto,jtext,takeover);
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "FishesCaught:[%d] BiggestFish:[%d] CrimesCommited:[%d] TimesArrested:[%d] WantedDeaths:[%d]", fishes,bigfish,crimes,arrests,warrests );
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Kills:[%d] Deaths:[%d] NextLevel:[$%d] Respect:[%d/%d] WantedLevel:[%d] Family:[%s]",kills,deaths,costlevel,exp,expamount,wanted,ftext);
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Pot:[%d] Crack:[%d] Materials:[%d] Team:[%s] Disease:[%s] Organisation:[%s] Rank:[%s]",pot,crack,mats,ttext,dtext,ftext,rtext);
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(coordsstring, sizeof(coordsstring), "Hauskey [%d] Businesskey [%d] HireKey [%d] int:[%d] local[%d] world[%d]", housekey,bizkey,HireCar[targetid],intir,local,world);
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE,"___________________________________________________________________");
    }
    }


    glaube aber eher, das das irgendwo daran liegt,
    wie oben schon gesagt...


    weil in stats tut sich nix.
    /wanted liste tut sich nix.
    Also die wanteds bekommt man garnicht.
    Manchmal wenn man zu oft macht und man 3wanteds hat,
    plötzlich wieder wantedlevel 1 usw...
    aber einglich sind sie net da


    achja
    und wanteds verschwinden nach einer zeit von alleine...

    2 Mal editiert, zuletzt von Jay ()