Ich habe nen Wunsch

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
  • //----------------------------------[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, "BENUTZUNG: (/su)spect [playerid/Name] [Verbrechen]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (gTeam[playerid] == 2 || IsACop(playerid))
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if (gTeam[giveplayerid] != 2 && !IsACop(giveplayerid))
    {
    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, "BENUTZUNG: (/su)spect [playerid/Name] [Verbrechen]");
    return 1;
    }
    if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 2; }
    else { WantedPoints[giveplayerid]+= 2; }
    SetPlayerCriminal(giveplayerid,playerid, result);
    //WantedLevel[giveplayerid]++;
    //SetPlayerWantedLevel(giveplayerid,WantedLevel[giveplayerid]);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du kannst keinen Polizisten anklagen !");
    }
    }
    }
    else
    {
    format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist kein Polizist / FBI / National Guard !");
    }
    }
    return 1;
    }

  • if(strcmp(cmd,"/su",true) == 0 || strcmp(cmd,"/suspect",true) == 0)
    {
    new tmp[128];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid,Farbe,"Benutze: /su [playerid] [Wanteds] [Grund]");
    return 1;
    }

    new giveplayerid = ReturnUser(tmp));
    tmp = strtok(cmdtext,idx);


    new giveplayer[MAX_PLAYER_NAME];
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));

    new Wanteds = strval(tmp);
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    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;


    PlayerInfo[giveplayerid][pWanteds] = level;


    new string[128];
    format(string,sizeof(string),"Du hast %s %d Wanteds gegeben",giveplayer, Wanteds);
    SendClientMessage(playerid,Farbe,string);
    format(string,sizeof(string),"Du hast %d Wanteds erhalten, Grund: %s", Wanteds, result);
    SendClientMessage(giveplayerid,Farbe,string);


    }
    }



    Sollte so in der Art funktionieren, natürlich brauchst du returnuser und strtok =)