Arrest Timer läuft nicht ab

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
  • Guten Tag,
    Der Timer läuft nicht ab.
    if (!strcmp("/arrest", cmd, true))
    {
    if (!IsACop(playerid)) return SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist kein Polizist / FBI Agent Soldier !");
    printf("Arrest 1");
    if (!OnDuty[playerid]) return SendClientMessage(playerid, COLOR_ERRORTEXT, "Du bist nicht im Dienst");
    printf("Arrest 2");
    if (!PlayerToPoint(6.0, playerid, 198.1741,158.6524,1003.0234) && !PlayerToPoint(6.0, playerid, 1565.5120,-1694.6105,5.8906) && !PlayerToPoint(6.0, playerid, 268.4561,84.9885,1001.0391) && !PlayerToPoint(6.0, playerid, 321.8767,314.1259,999.1484)) return SendClientMessage(playerid, COLOR_ERRORTEXT, "Du bist nicht in der Nähe der Zellen.");
    printf("Arrest 3");
    new suspect = GetClosestPlayer(playerid);
    if (GetDistanceBetweenPlayers(playerid, suspect) > 5) return SendClientMessage(playerid, COLOR_ERRORTEXT, "Der Spieler ist zu weit von dir entfernt.");
    printf("Arrest 4");
    if (PlayerInfo[suspect][pWantedLevel] < 1) return SendClientMessage(playerid, COLOR_ERRORTEXT, "Der Spieler muss mindestens 1 Wanted haben.");
    printf("Arrest 5");
    new giveplayer1[MAX_PLAYER_NAME], sendername1[MAX_PLAYER_NAME];
    GetPlayerName(suspect, giveplayer1, sizeof(giveplayer1));
    GetPlayerName(playerid, sendername1, sizeof(sendername1));
    format(string, sizeof(string), "* Du hast %s eingesperrt!", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    printf("Arrest 6");
    new bail = PlayerInfo[suspect][pWantedLevel] * 750; // Kautionsgeld
    GivePlayerMoneys(playerid, bail);
    format(string, sizeof(string), "Eingesperrt von %s ~n~fuer $%d", sendername, bail);
    GameTextForPlayer(suspect, string, 5000, 5);
    ResetPlayerWeapon(suspect);
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7) format(string, sizeof(string), "<< FBI Agent %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer1);
    else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) format(string, sizeof(string), "<< LSPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer1);
    else if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) format(string, sizeof(string), "<< SFPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer1);
    else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) format(string, sizeof(string), "<< LVPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer1);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    if(PlayerToPoint(6.0, playerid, 198.1741,158.6524,1003.0234))
    {
    PlayerInfo[suspect][pJailed] = 1;

    SetPlayerInterior(suspect, 3);
    SetPlayerPos(suspect,1565.3834,-1694.6147,5.8906);
    }
    if(PlayerToPoint(6.0, playerid, 268.5258,77.6269,1001.0391) || PlayerToPoint(6.0, playerid, 268.4561,84.9885,1001.0391) || PlayerToPoint(6.0, playerid, 321.8767,314.1259,999.1484))
    {
    PlayerInfo[suspect][pJailed] = 3;
    SetPlayerInterior(suspect, 6);
    new zufall = random(3);
    if(zufall == 1)
    {
    SetPlayerPos(suspect, 264.3521,82.2144,1001.0391);
    }
    else if(zufall == 2)
    {
    SetPlayerPos(suspect, 264.1788,86.7012,1001.0391);
    }
    else
    {
    SetPlayerPos(suspect, 264.7485,77.6824,1001.0391);
    }
    PlayerInfo[suspect][pLocal] = -1;
    }
    PlayerInfo[suspect][pJailTime] = PlayerInfo[suspect][pWantedLevel] * 240;
    JailPrice[suspect] = bail;
    format(string, sizeof(string), "Du wurdest für %d Minuten eingesperrt. Kaution: $%d", PlayerInfo[suspect][pJailTime]/60, JailPrice[suspect]);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    SetPlayerFree(suspect, playerid, string, 0);
    PlayerInfo[suspect][pArrested] += 1;
    PlayerInfo[suspect][pWantedLevel] = 0;
    WantLawyer[suspect] = 1;
    format(string,sizeof(string),"%s hat den Verdächtigen %s eingesperrt", sendername, giveplayer);
    Entertolog("arrest",string);
    }

  • Code entlassung:
    if(PlayerInfo[i][pJailed] > 0 && PlayerInfo[i][pJailed] != 5){
    if(PlayerInfo[i][pJailTime] > 0 && WantLawyer[i] == 0)
    {
    PlayerInfo[i][pJailTime] -= 1;
    }
    if(PlayerInfo[i][pJailTime] <= 0 && WantLawyer[i] == 0){
    PlayerInfo[i][pJailTime] = 0;
    if(PlayerInfo[i][pJailed] == 1){ //Freilassung SFPD
    SetPlayerInterior(i, 0);
    SetPlayerPos(i,-1605.3224,713.3950,13.4961);
    }
    else if(PlayerInfo[i][pJailed] == 2){ //Freilassung Prison
    SetPlayerPos(i, 1799.5938,-1578.0750,14.0743);
    SetPlayerFacingAngle(i, 0);
    CP[i] = 0;
    PlayerInfo[i][pJailed] = 0;
    SetPlayerSkin(i, PlayerInfo[i][pChar]);
    SetPlayerInterior(i, 0);
    }
    else if(PlayerInfo[i][pJailed] == 3){ // Freilassung LSPD
    SetPlayerInterior(i, 0);
    SetPlayerPos(i, 1552.8363,-1675.6121,16.1953);
    }
    SendClientMessage(i, COLOR_GRAD1," Du hast deine Schuld gegenüber der Gesellschaft beglichen.");
    format(string, sizeof(string), "~g~Freiheit~n~~w~Werde ein besserer Mensch");
    GameTextForPlayer(i, string, 5000, 1); PlayerInfo[i][pJailed] = 0; SetPlayerWorldBounds(i, 20000.0000,-20000.0000,20000.0000,-20000.0000); ClearCrime(i); SetPlayerToTeamColor(i); TogglePlayerControllable(i, 1);
    }
    }

  • Folgendes zu Bail:
    if(PlayerToPoint(6.0, playerid, 268.5258,77.6269,1001.0391) || PlayerToPoint(6.0, playerid, 268.4561,84.9885,1001.0391) || PlayerToPoint(6.0, playerid, 321.8767,314.1259,999.1484))
    {
    PlayerInfo[suspect][pJailed] = 3;
    SetPlayerInterior(suspect, 6);
    new zufall = random(3);
    if(zufall == 1)
    {
    SetPlayerPos(suspect, 264.3521,82.2144,1001.0391);
    }
    else if(zufall == 2)
    {
    SetPlayerPos(suspect, 264.1788,86.7012,1001.0391);
    }
    else
    {
    SetPlayerPos(suspect, 264.7485,77.6824,1001.0391);
    }
    PlayerInfo[suspect][pLocal] = -1;
    }
    PlayerInfo[suspect][pJailTime] = PlayerInfo[suspect][pWantedLevel] * 240;
    JailPrice[suspect] = bail;
    format(string, sizeof(string), "Du wurdest für %d Minuten eingesperrt. Kaution: $%d", PlayerInfo[suspect][pJailTime]/60, JailPrice[suspect]);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    SetPlayerFree(suspect, playerid, string, 0);
    PlayerInfo[suspect][pArrested] += 1;
    PlayerInfo[suspect][pWantedLevel] = 0;
    WantLawyer[suspect] = 1;
    format(string,sizeof(string),"%s hat den Verdächtigen %s eingesperrt", sendername, giveplayer);
    Entertolog("arrest",string);
    }

  • public SekundenTimer3()
    {
    new string[256],
    playername[MAX_PLAYER_NAME],
    Float:X,
    Float:Y,
    Float:Z;
    ForAllPlayers(i){
    if(IsPlayerConnected(i) && gPlayerLogged[i] && !IsPlayerNPC(i) && AFKModus[i] == 0){
    SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]);
    // Spectator
    if(Spectate[i] != -1){
    new targetid = Spectate[i];
    if(IsPlayerConnected(targetid)){
    if(PlayerInfo[i][pAdmin] >= 1){
    new Float:health,
    name[MAX_PLAYER_NAME];
    GetPlayerName(targetid, name, sizeof(name));
    GetPlayerHealth(targetid, health);
    format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~Health:%.1f",name,targetid,health);
    GameTextForPlayer(i, string, 2500, 3);
    }
    SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(targetid));
    SetPlayerInterior(i, GetPlayerInterior(targetid));
    }}
    if(PlayerInfo[i][pAdminOnDuty] == 1){ SetPlayerArmour(i, 2000.0); SetPlayerHealth(i, 200.0);}
    new Float:health;
    GetPlayerHealth(i,health);
    if(health > 160.0 && PlayerInfo[i][pAdminOnDuty] == 0){SetPlayerHealth(i, 160.0);}
    if(AntiAFKTime[i] > 0) {
    if(IsPlayerNPC(i) || PlayerInfo[i][pAdmin] == 2020 && AFKKick[i] == 0) {
    AntiAFKTimer[i] = 0;
    AntiAFKTime[i] = 0;
    AntiAFKCode[i] = 0;
    TextDrawHideForPlayer(i, AntiAFK[i]);
    }
    AntiAFKTime[i] += 1;
    if(AntiAFKTime[i] >= 60) {
    AntiAFKTimer[i] = 0;
    AntiAFKTime[i] = 0;
    if(Spectating[i] == -1 || PlayerCuffed[i] == 0) {
    if(AFKKick[i] == 1) {
    SendClientMessage(AFKChecker[i], COLOR_LIGHTBLUE,"Spieler hat Anwesenheit nicht bestätigt und wurde gekickt!");
    SendClientMessage(i, COLOR_LIGHTBLUE,"Du hast die Anwesenheit nicht bestätigt und wurdest somit gekickt!");
    TogglePlayerControllable(i, 0);
    Kick(i);
    }
    else {
    SendClientMessage(AFKChecker[i], COLOR_LIGHTBLUE, "Spieler hat Anwesenheit nicht bestätigt und wurde in den AFK-Modus versetzt");
    AFKChecker[i] = -1;
    TextDrawHideForPlayer(i, AntiAFK[i]);
    GetPlayerName(i, playername, sizeof(playername));
    }}}}
    else if(PlayerToPoint(2.0, i, 2262.1855,2040.5841,10.8203)) { GameTextForPlayer(i, "~w~Hier kannst du dein Auto~n~freikaufen,~n~falls es abgeschleppt wurde:~n~~g~/freecar", 2000, 3); }
    else if(PlayerToPoint(2.0, i, -372.9898,-1428.4983,25.7266)) { GameTextForPlayer(i, "~y~Benutze ~g~/gangunjail, ~y~/gangjail", 2000, 1); }
    else if(PlayerToPoint(2.0, i, 363.7162,173.7508,1008.3828)) { GameTextForPlayer(i, "~w~Um in das Jobmenu zu gelangen, benutze ~y~/jobs", 2000, 1); }
    else if(PlayerToPoint(2.0, i, 766.0630,13.2840,1000.7028)) { GameTextForPlayer(i, "~y~Um einen neuen Fightingstyle zu erlernen, benutze ~r~/fightingstyle", 2000, 3); }
    else if(PlayerToPoint(2.0, i, -2237.0854,130.2281,1035.4141)) { GameTextForPlayer(i, "~y~Um dir ein neues Handy zu kaufen, benutze ~r~/handys", 2000, 1); }
    else if(IsAtATM(i)) { GameTextForPlayer(i, "~y~Willkommen beim ~r~ATM ~g~/atm", 2000, 1); }
    else if(PlayerToPoint(2.0,i,2311.0659,-8.6369,26.7422)) { GameTextForPlayer(i, "~y~Willkommen in der ~r~Bank ~g~/bank", 2000, 1); }
    else if(PlayerToPoint(3.0, i, 1375.7318,-1640.7653,13.3828)) { GameTextForPlayer(i, "~g~Um mit dem Fuehrerschein zu beginnen, benutze ~y~/fahrschein", 2000, 1); }
    else if(PlayerToPoint(100, i,-30.875, -88.9609, 1004.53)) { GameTextForPlayer(i, "~y~Gib ~r~/buy ~y~ein, um dir etwas zu kaufen", 2000, 1); }
    else if(PlayerToPoint(2.0,i,376.5769,-68.2079,1001.5151) || PlayerToPoint(2.0,i,369.9709,-6.9479,1001.8589) || PlayerToPoint(2.0,i,374.6569,-119.6447,1001.4995)) { GameTextForPlayer(i, "Nutze /menu um dir Essen zu kaufen", 2000, 1); }
    for(new z = 0; z < sizeof(ZollSystemInfo); z++){if(PlayerToPoint(10.0, i, ZollSystemInfo[z][ZSObjectPosX], ZollSystemInfo[z][ZSObjectPosY], ZollSystemInfo[z][ZSObjectPosZ])) { GameTextForPlayer(i, "~y~Gib ~g~/zoll ~y~ein um den Zoll zu oeffnen", 2000, 3); }}
    if(GetPlayerSkin(i) == 0 || GetPlayerSkin(i) < 0 || GetPlayerSkin(i) == -1 || GetPlayerSkin(i) == 74)
    { SetPlayerSkin(i,101); }
    if(TransportTime[i] > 0){
    if(TransportTime[i] >= 16){
    TransportTime[i] = 1;
    if(TransportDriver[i] < 999){
    if(IsPlayerConnected(TransportDriver[i])){
    TransportCost[i] += TransportValue[TransportDriver[i]];
    TransportCost[TransportDriver[i]] = TransportCost[i];
    }
    }
    }
    TransportTime[i] += 1;
    format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]);
    GameTextForPlayer(i, string, 15000, 6);
    }
    if(PlayerInfo[i][pJailed] > 0 && PlayerInfo[i][pJailed] != 5){
    printf("pJailed: %d / i:%d", PlayerInfo[i][pJailed], i);
    if(PlayerInfo[i][pJailTime] > 0 && WantLawyer[i] == 0)
    {
    PlayerInfo[i][pJailTime] -= 1;
    }
    if(PlayerInfo[i][pJailTime] <= 0 && WantLawyer[i] == 0){
    PlayerInfo[i][pJailTime] = 0;
    if(PlayerInfo[i][pJailed] == 1){ //Freilassung SFPD
    SetPlayerInterior(i, 0);
    SetPlayerPos(i,-1605.3224,713.3950,13.4961);
    }
    else if(PlayerInfo[i][pJailed] == 2){ //Freilassung Prison
    SpawnPlayer(i);
    CP[i] = 0;
    PlayerInfo[i][pJailed] = 0;
    SetPlayerSkin(i, PlayerInfo[i][pChar]);
    SetPlayerInterior(i, 0);
    }
    else if(PlayerInfo[i][pJailed] == 3){ // Freilassung LSPD
    SetPlayerInterior(i, 0);
    SetPlayerPos(i, 1552.8363,-1675.6121,16.1953);
    }
    SendClientMessage(i, COLOR_GRAD1," Du hast deine Schuld gegenüber der Gesellschaft beglichen.");
    format(string, sizeof(string), "~g~Freiheit~n~~w~Werde ein besserer Mensch");
    GameTextForPlayer(i, string, 5000, 1); PlayerInfo[i][pJailed] = 0; SetPlayerWorldBounds(i, 20000.0000,-20000.0000,20000.0000,-20000.0000); ClearCrime(i); SetPlayerToTeamColor(i); TogglePlayerControllable(i, 1);
    }
    }
    if(PlayerTazeTime[i] > 0) {
    PlayerTazeTime[i] += 1;
    if(PlayerTazeTime[i] == 15){PlayerTazeTime[i] = 0; }
    else { new Float:angle; GetPlayerFacingAngle(i, angle); SetPlayerFacingAngle(i, angle + 90); }
    }
    if(GetPlayerDrunkLevel(i) >= 2000){
    if(GetPlayerDrunkLevel(i) >= 30000) { ApplyAnimation(i,"CRACK","crckdeth2",4.0, 1,0, 0, 0, 0); }
    else if(GetPlayerDrunkLevel(i) >= 29900 && GetPlayerDrunkLevel(i) <= 30000) { SetPlayerSpecialAction(i, 0); ClearAnimations(i); } }
    if(PlayerStoned[i] >= 5) {
    if(PlayerStonedTime[i] > 0) { ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); PlayerStonedTime[i] -= 1; }
    PlayerStoned[i] += 1;
    if(PlayerStoned[i] == 15) {
    PlayerStoned[i] = 2;
    new Float:angle;
    GetPlayerFacingAngle(i, angle);
    if(IsPlayerInAnyVehicle(i)) {
    if(GetPlayerState(i) == 2) { SetVehicleZAngle(GetPlayerVehicleID(i), angle + 25); }
    }
    else { SetPlayerFacingAngle(i, angle + 90); }
    }}
    if(PlayerInfo[i][pCarTime] != 0){
    if(PlayerInfo[i][pCarTime] > 0) { PlayerInfo[i][pCarTime] -= 1; }
    if(PlayerInfo[i][pCarTime] < 0) { PlayerInfo[i][pCarTime] = 0; }
    }
    if(JobFreeze[i] > 0){JobFreeze[i] -= 1;}
    if(Logintime[i] >= 0){Logintime[i] += 1;}
    if(HotdogTime[i] > 0){HotdogTime[i] -= 1;}
    if(PortedTimer[i] > 0){PortedTimer[i] -= 1;}
    if(FindTime[i] > 0) {
    if(FindTime[i] == FindTimePoints[i]) {
    FindTime[i] = 0;
    FindTimePoints[i] = 0;
    DisablePlayerCheckpoint(i);
    GameTextForPlayer(i, "~r~Redmarker weg", 2500, 1);
    }
    else {
    format(string, sizeof(string), "%d", FindTimePoints[i] - FindTime[i]);
    GameTextForPlayer(i, string, 1500, 6);
    FindTime[i] += 1;
    }}
    if(AntiSpamTime[i] > 0){
    AntiSpamTime[i] -= 1;
    if(AntiSpamTime[i] == 0){
    AntiSpamWarns[i] = 0;
    }}
    if(TaxiCallTime[i] > 0) {
    if(TaxiAccepted[i] < 999){
    if(IsPlayerConnected(TaxiAccepted[i])){
    GetPlayerPos(TaxiAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5);
    }}}
    if(MedicAccepted[i] != -1){GetPlayerPos(MedicAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5); CP[i] = 71;}
    if(WheelmanAccepted[i] != -1){GetPlayerPos(WheelmanAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5); CP[i] = 72;}
    if(MechanicCallTime[i] > 0){
    if(MechanicCallTime[i] == 90){
    MechanicCallTime[i] = 0; DisablePlayerCheckpoint(i); GameTextForPlayer(i, "~r~Redmarker weg", 2500, 1);
    }
    else {
    format(string, sizeof(string), "%d", 90 - MechanicCallTime[i]); GameTextForPlayer(i, string, 1500, 6); MechanicCallTime[i] += 1;
    }}
    if(AntiRobTimer[i] > 0){AntiRobTimer[i] -= 1;}
    if(PlayerCuffed[i] == 1){
    if(PlayerCuffedTime[i] <= 0) {
    TogglePlayerControllable(i, 1); PlayerCuffed[i] = 0; PlayerCuffedTime[i] = 0; PlayerTazeTime[i] = 1; SetPlayerSpecialAction(i, 0); ClearAnimations(i);
    }
    else{
    PlayerCuffedTime[i] -= 1;
    }}
    if(PlayerCuffed[i] == 2){
    if(PlayerCuffedTime[i] <= 0){
    GameTextForPlayer(i, "~g~Du hast deine Handschellen geknackt, schnell fluechte!", 2500, 3);
    TogglePlayerControllable(i, 1); PlayerCuffed[i] = 0; PlayerCuffedTime[i] = 0; PlayerTied[i] = 0; SetPlayerSpecialAction(i, 0); ClearAnimations(i);
    }
    else{
    PlayerCuffedTime[i] -= 1;
    }}
    if(StartingPaintballRound == 1 && AnnouncedPaintballRound == 0){
    AnnouncedPaintballRound = 1;
    if(PlayerPaintballing[i] == 1)
    {
    SendClientMessage(i, COLOR_YELLOW, "Paintball Match wird für 15 Sekunden hinausgezögert, um mehr Spieler zu errreichen.");
    }
    }
    if(StartingKartRound == 1 && AnnouncedKartRound == 0){
    AnnouncedKartRound = 1;
    if(PlayerKarting[i] != 0 && PlayerInKart[i] != 0)
    {
    SendClientMessage(i, COLOR_YELLOW, "Kart Rennen wird für 15 Sekunden hinausgezögert, um mehr Spieler zu errreichen.");
    }
    }
    if(EndingKartRound == 1){
    if(PlayerKarting[i] != 0 && PlayerInKart[i] != 0)
    {
    DisablePlayerCheckpoint(i);
    CP[i] = 0;
    }}}}
    return 1;
    }

  • Was wird geprintet, wenn du es so schreibst?

    Spoiler anzeigen
    public SekundenTimer3()
    {
    printf("SekundenTimer aufgerufen");
    new string[256],
    playername[MAX_PLAYER_NAME],
    Float:X,
    Float:Y,
    Float:Z;
    ForAllPlayers(i)
    {
    printf("i:%d | %d | %d | %d | %d", i,IsPlayerConnected(i),gPlayerLogged[i],IsPlayerNPC(i),AFKModus[i]);
    if(IsPlayerConnected(i) && gPlayerLogged[i] && !IsPlayerNPC(i) && AFKModus[i] == 0)
    {
    printf("Spieler: %d", i);
    SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]);
    // Spectator
    if(Spectate[i] != -1)
    {
    new targetid = Spectate[i];
    if(IsPlayerConnected(targetid))
    {
    if(PlayerInfo[i][pAdmin] >= 1)
    {
    new Float:health,
    name[MAX_PLAYER_NAME];
    GetPlayerName(targetid, name, sizeof(name));
    GetPlayerHealth(targetid, health);
    format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~Health:%.1f",name,targetid,health);
    GameTextForPlayer(i, string, 2500, 3);
    }
    SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(targetid));
    SetPlayerInterior(i, GetPlayerInterior(targetid));
    }
    }
    if(PlayerInfo[i][pAdminOnDuty] == 1)
    {
    SetPlayerArmour(i, 2000.0); SetPlayerHealth(i, 200.0);
    }
    new Float:health;
    GetPlayerHealth(i,health);
    if(health > 160.0 && PlayerInfo[i][pAdminOnDuty] == 0)
    {
    SetPlayerHealth(i, 160.0);
    }
    if(AntiAFKTime[i] > 0)
    {
    if(IsPlayerNPC(i) || PlayerInfo[i][pAdmin] == 2020 && AFKKick[i] == 0)
    {
    AntiAFKTimer[i] = 0;
    AntiAFKTime[i] = 0;
    AntiAFKCode[i] = 0;
    TextDrawHideForPlayer(i, AntiAFK[i]);
    }
    AntiAFKTime[i] += 1;
    if(AntiAFKTime[i] >= 60)
    {
    AntiAFKTimer[i] = 0;
    AntiAFKTime[i] = 0;
    if(Spectating[i] == -1 || PlayerCuffed[i] == 0)
    {
    if(AFKKick[i] == 1)
    {
    SendClientMessage(AFKChecker[i], COLOR_LIGHTBLUE,"Spieler hat Anwesenheit nicht bestätigt und wurde gekickt!");
    SendClientMessage(i, COLOR_LIGHTBLUE,"Du hast die Anwesenheit nicht bestätigt und wurdest somit gekickt!");
    TogglePlayerControllable(i, 0);
    Kick(i);
    }
    else
    {
    SendClientMessage(AFKChecker[i], COLOR_LIGHTBLUE, "Spieler hat Anwesenheit nicht bestätigt und wurde in den AFK-Modus versetzt");
    AFKChecker[i] = -1;
    TextDrawHideForPlayer(i, AntiAFK[i]);
    GetPlayerName(i, playername, sizeof(playername));
    }
    }
    }
    }
    else if(PlayerToPoint(2.0, i, 2262.1855,2040.5841,10.8203))
    {
    GameTextForPlayer(i, "~w~Hier kannst du dein Auto~n~freikaufen,~n~falls es abgeschleppt wurde:~n~~g~/freecar", 2000, 3);
    }
    else if(PlayerToPoint(2.0, i, -372.9898,-1428.4983,25.7266))
    {
    GameTextForPlayer(i, "~y~Benutze ~g~/gangunjail, ~y~/gangjail", 2000, 1);
    }
    else if(PlayerToPoint(2.0, i, 363.7162,173.7508,1008.3828))
    {
    GameTextForPlayer(i, "~w~Um in das Jobmenu zu gelangen, benutze ~y~/jobs", 2000, 1);
    }
    else if(PlayerToPoint(2.0, i, 766.0630,13.2840,1000.7028))
    {
    GameTextForPlayer(i, "~y~Um einen neuen Fightingstyle zu erlernen, benutze ~r~/fightingstyle", 2000, 3);
    }
    else if(PlayerToPoint(2.0, i, -2237.0854,130.2281,1035.4141))
    {
    GameTextForPlayer(i, "~y~Um dir ein neues Handy zu kaufen, benutze ~r~/handys", 2000, 1);
    }
    else if(IsAtATM(i))
    {
    GameTextForPlayer(i, "~y~Willkommen beim ~r~ATM ~g~/atm", 2000, 1);
    }
    else if(PlayerToPoint(2.0,i,2311.0659,-8.6369,26.7422))
    {
    GameTextForPlayer(i, "~y~Willkommen in der ~r~Bank ~g~/bank", 2000, 1);
    }
    else if(PlayerToPoint(3.0, i, 1375.7318,-1640.7653,13.3828))
    {
    GameTextForPlayer(i, "~g~Um mit dem Fuehrerschein zu beginnen, benutze ~y~/fahrschein", 2000, 1);
    }
    else if(PlayerToPoint(100, i,-30.875, -88.9609, 1004.53))
    {
    GameTextForPlayer(i, "~y~Gib ~r~/buy ~y~ein, um dir etwas zu kaufen", 2000, 1);
    }
    else if(PlayerToPoint(2.0,i,376.5769,-68.2079,1001.5151) || PlayerToPoint(2.0,i,369.9709,-6.9479,1001.8589) || PlayerToPoint(2.0,i,374.6569,-119.6447,1001.4995))
    {
    GameTextForPlayer(i, "Nutze /menu um dir Essen zu kaufen", 2000, 1);
    }
    for(new z = 0; z < sizeof(ZollSystemInfo); z++)
    {
    if(PlayerToPoint(10.0, i, ZollSystemInfo[z][ZSObjectPosX], ZollSystemInfo[z][ZSObjectPosY], ZollSystemInfo[z][ZSObjectPosZ]))
    {
    GameTextForPlayer(i, "~y~Gib ~g~/zoll ~y~ein um den Zoll zu oeffnen", 2000, 3);
    }
    }
    if(GetPlayerSkin(i) == 0 || GetPlayerSkin(i) < 0 || GetPlayerSkin(i) == -1 || GetPlayerSkin(i) == 74)
    {
    SetPlayerSkin(i,101);
    }
    if(TransportTime[i] > 0)
    {
    if(TransportTime[i] >= 16)
    {
    TransportTime[i] = 1;
    if(TransportDriver[i] < 999)
    {
    if(IsPlayerConnected(TransportDriver[i]))
    {
    TransportCost[i] += TransportValue[TransportDriver[i]];
    TransportCost[TransportDriver[i]] = TransportCost[i];
    }
    }
    }
    TransportTime[i] += 1;
    format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]);
    GameTextForPlayer(i, string, 15000, 6);
    }
    printf("pJailed: %d / i:%d", PlayerInfo[i][pJailed], i);
    if(PlayerInfo[i][pJailed] > 0 && PlayerInfo[i][pJailed] != 5)
    {
    if(PlayerInfo[i][pJailTime] > 0 && WantLawyer[i] == 0)
    {
    PlayerInfo[i][pJailTime] -= 1;
    }
    if(PlayerInfo[i][pJailTime] <= 0 && WantLawyer[i] == 0)
    {
    PlayerInfo[i][pJailTime] = 0;
    if(PlayerInfo[i][pJailed] == 1)
    {
    //Freilassung SFPD
    SetPlayerInterior(i, 0);
    SetPlayerPos(i,-1605.3224,713.3950,13.4961);
    }
    else if(PlayerInfo[i][pJailed] == 2)
    {
    //Freilassung Prison
    SpawnPlayer(i);
    CP[i] = 0;
    PlayerInfo[i][pJailed] = 0;
    SetPlayerSkin(i, PlayerInfo[i][pChar]);
    SetPlayerInterior(i, 0);
    }
    else if(PlayerInfo[i][pJailed] == 3)
    {
    // Freilassung LSPD
    SetPlayerInterior(i, 0);
    SetPlayerPos(i, 1552.8363,-1675.6121,16.1953);
    }
    SendClientMessage(i, COLOR_GRAD1," Du hast deine Schuld gegenüber der Gesellschaft beglichen.");
    format(string, sizeof(string), "~g~Freiheit~n~~w~Werde ein besserer Mensch");
    GameTextForPlayer(i, string, 5000, 1); PlayerInfo[i][pJailed] = 0; SetPlayerWorldBounds(i, 20000.0000,-20000.0000,20000.0000,-20000.0000); ClearCrime(i); SetPlayerToTeamColor(i); TogglePlayerControllable(i, 1);
    }
    }
    if(PlayerTazeTime[i] > 0)
    {
    PlayerTazeTime[i] += 1;
    if(PlayerTazeTime[i] == 15)
    {
    PlayerTazeTime[i] = 0;
    }
    else
    {
    new Float:angle; GetPlayerFacingAngle(i, angle); SetPlayerFacingAngle(i, angle + 90);
    }
    }
    if(GetPlayerDrunkLevel(i) >= 2000)
    {
    if(GetPlayerDrunkLevel(i) >= 30000)
    {
    ApplyAnimation(i,"CRACK","crckdeth2",4.0, 1,0, 0, 0, 0);
    }
    else if(GetPlayerDrunkLevel(i) >= 29900 && GetPlayerDrunkLevel(i) <= 30000)
    {
    SetPlayerSpecialAction(i, 0); ClearAnimations(i);
    }
    }
    if(PlayerStoned[i] >= 5)
    {
    if(PlayerStonedTime[i] > 0)
    {
    ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); PlayerStonedTime[i] -= 1;
    }
    PlayerStoned[i] += 1;
    if(PlayerStoned[i] == 15)
    {
    PlayerStoned[i] = 2;
    new Float:angle;
    GetPlayerFacingAngle(i, angle);
    if(IsPlayerInAnyVehicle(i))
    {
    if(GetPlayerState(i) == 2)
    {
    SetVehicleZAngle(GetPlayerVehicleID(i), angle + 25);
    }
    }
    else
    {
    SetPlayerFacingAngle(i, angle + 90);
    }
    }
    }
    if(PlayerInfo[i][pCarTime] != 0)
    {
    if(PlayerInfo[i][pCarTime] > 0)
    {
    PlayerInfo[i][pCarTime] -= 1;
    }
    if(PlayerInfo[i][pCarTime] < 0)
    {
    PlayerInfo[i][pCarTime] = 0;
    }
    }
    if(JobFreeze[i] > 0)
    {
    JobFreeze[i] -= 1;
    }
    if(Logintime[i] >= 0)
    {
    Logintime[i] += 1;
    }
    if(HotdogTime[i] > 0)
    {
    HotdogTime[i] -= 1;
    }
    if(PortedTimer[i] > 0)
    {
    PortedTimer[i] -= 1;
    }
    if(FindTime[i] > 0)
    {
    if(FindTime[i] == FindTimePoints[i])
    {
    FindTime[i] = 0;
    FindTimePoints[i] = 0;
    DisablePlayerCheckpoint(i);
    GameTextForPlayer(i, "~r~Redmarker weg", 2500, 1);
    }
    else
    {
    format(string, sizeof(string), "%d", FindTimePoints[i] - FindTime[i]);
    GameTextForPlayer(i, string, 1500, 6);
    FindTime[i] += 1;
    }
    }
    if(AntiSpamTime[i] > 0)
    {
    AntiSpamTime[i] -= 1;
    if(AntiSpamTime[i] == 0)
    {
    AntiSpamWarns[i] = 0;
    }
    }
    if(TaxiCallTime[i] > 0)
    {
    if(TaxiAccepted[i] < 999)
    {
    if(IsPlayerConnected(TaxiAccepted[i]))
    {
    GetPlayerPos(TaxiAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5);
    }
    }
    }
    if(MedicAccepted[i] != -1)
    {
    GetPlayerPos(MedicAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5); CP[i] = 71;
    }
    if(WheelmanAccepted[i] != -1)
    {
    GetPlayerPos(WheelmanAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5); CP[i] = 72;
    }
    if(MechanicCallTime[i] > 0)
    {
    if(MechanicCallTime[i] == 90)
    {
    MechanicCallTime[i] = 0; DisablePlayerCheckpoint(i); GameTextForPlayer(i, "~r~Redmarker weg", 2500, 1);
    }
    else
    {
    format(string, sizeof(string), "%d", 90 - MechanicCallTime[i]); GameTextForPlayer(i, string, 1500, 6); MechanicCallTime[i] += 1;
    }
    }
    if(AntiRobTimer[i] > 0)
    {
    AntiRobTimer[i] -= 1;
    }
    if(PlayerCuffed[i] == 1)
    {
    if(PlayerCuffedTime[i] <= 0)
    {
    TogglePlayerControllable(i, 1); PlayerCuffed[i] = 0; PlayerCuffedTime[i] = 0; PlayerTazeTime[i] = 1; SetPlayerSpecialAction(i, 0); ClearAnimations(i);
    }
    else
    {
    PlayerCuffedTime[i] -= 1;
    }
    }
    if(PlayerCuffed[i] == 2)
    {
    if(PlayerCuffedTime[i] <= 0)
    {
    GameTextForPlayer(i, "~g~Du hast deine Handschellen geknackt, schnell fluechte!", 2500, 3);
    TogglePlayerControllable(i, 1); PlayerCuffed[i] = 0; PlayerCuffedTime[i] = 0; PlayerTied[i] = 0; SetPlayerSpecialAction(i, 0); ClearAnimations(i);
    }
    else
    {
    PlayerCuffedTime[i] -= 1;
    }
    }
    if(StartingPaintballRound == 1 && AnnouncedPaintballRound == 0)
    {
    AnnouncedPaintballRound = 1;
    if(PlayerPaintballing[i] == 1)
    {
    SendClientMessage(i, COLOR_YELLOW, "Paintball Match wird für 15 Sekunden hinausgezögert, um mehr Spieler zu errreichen.");
    }
    }
    if(StartingKartRound == 1 && AnnouncedKartRound == 0)
    {
    AnnouncedKartRound = 1;
    if(PlayerKarting[i] != 0 && PlayerInKart[i] != 0)
    {
    SendClientMessage(i, COLOR_YELLOW, "Kart Rennen wird für 15 Sekunden hinausgezögert, um mehr Spieler zu errreichen.");
    }
    }
    if(EndingKartRound == 1)
    {
    if(PlayerKarting[i] != 0 && PlayerInKart[i] != 0)
    {
    DisablePlayerCheckpoint(i);
    CP[i] = 0;
    }
    }
    }
    }
    return 1;
    }



    (Ich habe mir erlaubt den Code mal richtig einzurücken.)



    EDIT:
    Dome_: Habe noch einen print hinzugefügt. Aktualisiere deinen Code falls du es schon kopiert hast.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Beitrag von Dome_ ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • Nein Leider nicht der Befehl wurde damals umgeschrieben das ist der Standart Befehl:
    /*if(strcmp("/arrest", cmd, true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsACop(playerid))
    {
    if(OnDuty[playerid] != 1)
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist nicht im Dienst!");
    return 1;
    }
    if(PlayerToPoint(6.0, playerid, 198.1741,158.6524,1003.0234) || PlayerToPoint(6.0, playerid, 268.5258,77.6269,1001.0391) || PlayerToPoint(6.0, playerid, 268.4561,84.9885,1001.0391) || PlayerToPoint(6.0, playerid, 321.8767,314.1259,999.1484))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
    return 1;
    }
    moneys = strval(tmp);
    if(moneys < 1 || moneys > 200000) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Gefängnispreis kann nur zwischen $1 und $200000 liegen!"); return 1; }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
    return 1;
    }
    new bail = strval(tmp);
    if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Kaution kann nur mit 0 oder 1 festgelegt werden!"); return 1; }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
    return 1;
    }
    new bailprice = strval(tmp);
    if(bailprice < 0 || bailprice > 100000000) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Gefängnis Kaution kann nur zwischen $0 und $100.000.000 liegen!"); return 1; }
    new suspect = GetClosestPlayer(playerid);
    if(IsPlayerConnected(suspect))
    {
    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
    {
    GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[suspect][pWantedLevel] < 1)
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Der Spieler muss mindestens Wanted Level 1 haben!");
    return 1;
    }
    format(string, sizeof(string), "* Du hast %s eingesperrt!", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    new SteuerkasseMoney = moneys;
    GivePlayerMoneys(playerid, moneys/2);
    StuffInfo[sSteuerkasse] += SteuerkasseMoney/2;
    StuffInfo[sEinnahmen] += SteuerkasseMoney/2;
    format(string, sizeof(string), "Eingesperrt von %s ~n~fuer $%d", sendername, moneys);
    GameTextForPlayer(suspect, string, 5000, 5);
    ResetPlayerWeapon(suspect);
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
    {
    format(string, sizeof(string), "<< FBI Agent %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    }
    else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
    format(string, sizeof(string), "<< LSPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    }
    else if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
    {
    format(string, sizeof(string), "<< SFPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    }
    else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    format(string, sizeof(string), "<< LVPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    }
    if(PlayerToPoint(6.0, playerid, 198.1741,158.6524,1003.0234))
    {
    PlayerInfo[suspect][pJailed] = 1;
    SetPlayerInterior(suspect, 3);
    SetPlayerPos(suspect,198.8241,161.8588,1003.0300);
    }
    if(PlayerToPoint(6.0, playerid, 268.5258,77.6269,1001.0391) || PlayerToPoint(6.0, playerid, 268.4561,84.9885,1001.0391) || PlayerToPoint(6.0, playerid, 321.8767,314.1259,999.1484))
    {
    PlayerInfo[suspect][pJailed] = 3;
    SetPlayerInterior(suspect, 6);
    new zufall = random(3);
    if(zufall == 1)
    {
    SetPlayerPos(suspect, 264.3521,82.2144,1001.0391);
    }
    else if(zufall == 2)
    {
    SetPlayerPos(suspect, 264.1788,86.7012,1001.0391);
    }
    else
    {
    SetPlayerPos(suspect, 264.7485,77.6824,1001.0391);
    }
    PlayerInfo[suspect][pLocal] = -1;
    }
    PlayerInfo[suspect][pJailTime] = PlayerInfo[suspect][pWantedLevel]* 3 * 60;
    if(bail == 1)
    {
    JailPrice[suspect] = bailprice;
    format(string, sizeof(string), "Du wurdest für %d Minuten eingesperrt. Kaution: $%d", PlayerInfo[suspect][pJailTime]/60, JailPrice[suspect]);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    }
    else
    {
    JailPrice[suspect] = 0;
    format(string, sizeof(string), "Du wurdest für %d Minuten eingesperrt. Kaution: Unmöglich", PlayerInfo[suspect][pJailTime]/60);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    }
    SetPlayerFree(suspect, playerid, string, 0);
    PlayerInfo[suspect][pArrested] += 1;
    PlayerInfo[suspect][pWantedLevel] = 0;
    WantLawyer[suspect] = 1;
    format(string,sizeof(string),"%s hat den Verdächtigen %s eingesperrt", sendername, giveplayer);
    Entertolog("arrest",string);
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Niemand ist in deiner Nähe den du einsperren kannst !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist nicht in der Nähe der Zellen !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist kein Polizist / FBI Agent Soldier !");
    return 1;
    }
    }
    return 1;
    }*/

  • Na dann ist es auch kein Wunder. :D
    Füge bei OnGameModeInit das ein:


    SetTimer("SekundenTimer3", 1000, true);


    Funktioniert es dann, dass du aus dem Knast kommst?
    Wenn nein, was wird geprintet?


    Funktioniert nicht man wird auch nicht geportet oder sonst was geprintet ebenfalls nix ausser bei /arrest:


    [01:04:35] Arrest 1
    [01:04:35] Arrest 2
    [01:04:35] Arrest 3
    [01:04:35] Arrest 4
    [01:04:35] Arrest 5
    [01:04:35] Arrest 6

  • Kann doch nicht sein, dass der Timer nicht aufgerufen wird. :wacko:
    Hast du irgendwelche Meldungen im Compiler?


    Hast du
    SetTimer("SekundenTimer3", 1000, true);
    mal direkt als erste Zeile in OnGameModeInit eingefügt, also direkt nach dem public und der ersten geschwungenen Klammer?

  • Kann doch nicht sein, dass der Timer nicht aufgerufen wird. :wacko:
    Hast du irgendwelche Meldungen im Compiler?


    Hast du
    SetTimer("SekundenTimer3", 1000, true);
    mal direkt als erste Zeile in OnGameModeInit eingefügt, also direkt nach dem public und der ersten geschwungenen Klammer?


    Hab das noch gefunden:
    SetProTimer("SetSekundenTimer3", 300, false);

  • Das ruft aber das "public SetSekundenTimer3()" auf. Sollte allerdings nichts daran ändern, dass die Zeile die ich dir gegeben habe eigentlich deinen Timer starten soll.


    Deshalb nochmal die Fragen:
    - Hast du Meldungen im Compiler?
    - Hast du es mal direkt als erste Zeile in OnGameModeInit gesetzt, das SetTimer das ich dir gegeben habe, mit den 1000 ms?

  • Das ruft aber das "public SetSekundenTimer3()" auf. Sollte allerdings nichts daran ändern, dass die Zeile die ich dir gegeben habe eigentlich deinen Timer starten soll.


    Deshalb nochmal die Fragen:
    - Hast du Meldungen im Compiler?
    - Hast du es mal direkt als erste Zeile in OnGameModeInit gesetzt, das SetTimer das ich dir gegeben habe, mit den 1000 ms?


    ich hab nur warnings welche mit dem nix zutun haben. Es wird weiterhin nix geprintet.

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