Hilfe bei /arrest

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
  • Hi @ all


    Also ich habe ein selfmade und habe aber für meine Polizei noch kein /arrest und ich habe auch kein Plan wie das funkt
    es soll sein dass ich /einsperren[id][zeit] eingeben kann
    ich hoffe ihr könnt mir helfen
    sufu habe ich nichts gescheites gefunden
    MFG Mipu

    Einmal editiert, zuletzt von Optiimal ()

  • Aus nem GodFather:


    if(strcmp(cmd, "/arrest", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gTeam[playerid] == 2 || IsACop(playerid))
    {
    if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not on Duty!");
    return 1;
    }
    if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391))
    {// Jail spot
    SendClientMessage(playerid, COLOR_GREY, " You are not near the Jail, can't Arrest !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
    return 1;
    }
    moneys = strval(tmp);
    if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " Jail Price can't be below $1 or above $99999 !"); return 1; }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
    return 1;
    }
    new time = strval(tmp);
    if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
    return 1;
    }
    new bail = strval(tmp);
    if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below 0 or above 1 !"); return 1; }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
    return 1;
    }
    new bailprice = strval(tmp);
    if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below $0 or above $3000000 !"); 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(WantedLevel[suspect] < 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Player must be at least Wanted Level 1 !");
    return 1;
    }
    format(string, sizeof(string), "* You arrested %s !", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    GivePlayerMoney(suspect, -moneys);
    format(string, sizeof(string), "arrested by %s ~n~ for $%d", sendername, moneys);
    GameTextForPlayer(suspect, string, 5000, 5);
    ResetPlayerWeapons(suspect);
    if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
    {
    format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
    OOCNews(COLOR_LIGHTRED, string);
    }
    else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
    {
    format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
    OOCNews(COLOR_LIGHTRED, string);
    }
    else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
    {
    format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
    OOCNews(COLOR_LIGHTRED, string);
    }
    SetPlayerInterior(suspect, 6);
    SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
    PlayerInfo[suspect][pJailTime] = time * 60;
    if(bail == 1)
    {
    JailPrice[suspect] = bailprice;
    format(string, sizeof(string), "You are jailed for %d seconds. Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    }
    else
    {
    JailPrice[suspect] = 0;
    format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[suspect][pJailTime]);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    }
    PlayerInfo[suspect][pJailed] = 1;
    PlayerInfo[suspect][pArrested] += 1;
    SetPlayerFree(suspect,playerid, "Got Arrested");
    WantedPoints[suspect] = 0;
    WantedLevel[suspect] = 0;
    WantLawyer[suspect] = 1;
    }//distance
    }//not connected
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " No-one close enough to arrest.");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !");
    return 1;
    }
    }//not connected
    return 1;
    }


    Man muss bei den LSPD Zellen sein und wird dann in die einzige Zuhe Zelle Teleportiert.


    Command: /arrest [Preis] [Zeit (minuten)] [Kaution (0=Nein 1=Ja)] [Kautionspreis]
    Dann noch der CMD um die Kaution anzunehmen:
    if(strcmp(cmd, "/bail", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pJailed]==1)
    {
    if(JailPrice[playerid] > 0)
    {
    if(GetPlayerMoney(playerid) > JailPrice[playerid])
    {
    format(string, sizeof(string), "You bailed yourself out for: $%d", JailPrice[playerid]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    GivePlayerMoney(playerid, -JailPrice[playerid]);
    JailPrice[playerid] = 0;
    WantLawyer[playerid] = 0; CallLawyer[playerid] = 0;
    PlayerInfo[playerid][pJailTime] = 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " You can't afford the Bail Price !");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " You don't have a Bail Price !");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " You are not in Jail !");
    }
    }//not connected
    return 1;
    }


    MfG Firer

  • nein nur anstöse will das ja selber lernen :D
    am wenigsten kenn ich mich mit denn timer aus da hilft mir das wiki auch nicht )=
    MFG Mipu


    Edit: habe mir das so vorgestellt weis aber nicht ob das funkt


    new arresttimer;
    Settimer"arresttimer"60000,1);


    if(strcmp(strget(cmdtext,0),"/einsperren",true) == 0)
    {
    if(!IsPlayerConnected(playerid))
    {



    SendClientMessage(playerid,COLOR_GREY,"Diesen Spieler gibt es nicht.");
    return 1;
    }
    if(Spieler[playerid][pduty] >= 1 )
    if(Spieler[playerid][team] == 2)


    {
    if(!strlen(strget(cmdtext,1)))


    {
    SendClientMessage(playerid,COLOR_YELLOW,"Verwendung: /einsperren [ID]");
    return 1;
    }
    new msg1[200];
    new msg2[200];
    new ziel = strval(strget(cmdtext,1));
    new opfer[MAX_PLAYER_NAME];
    new spieler[MAX_PLAYER_NAME];
    if(GetDistanceBetweenPlayers(playerid,ziel) < 5)
    GetPlayerName(playerid,spieler,sizeof(spieler));
    GetPlayerName(ziel,opfer,sizeof(opfer));
    format(msg1,sizeof(msg1),"** Du hast %s eingesperrt.",playerid,cmdtext[8]);
    format(msg2,sizeof(msg2),"** Du wurdest von %s eingesperrt.",ziel,cmdtext[8]);
    SendClientMessage(playerid,COLOR_LIGHTRED,msg1);
    SendClientMessage(ziel,COLOR_LIGHTRED,msg2);
    SetPlayerPos(ziel,264.6288,77.5742,1001.0391
    if Spieler[ziel][wanted] = 1 ); // Hier bei ein wanted 10 mins
    if Spieler[ziel][wanted] = 2); // und hier bei zwei wanteds 20 mins
    if Spieler[ziel][wanted] = 3); // und hier bei drei wanteds 30 mins
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_GRAD2,"Du darfst diesen Command nicht nutzen!");
    }
    }



    Wie mache ich das mit der Zeit also wenn ich ein wanted habe das ich nach zehn min raus komme bei 2 nach 20 mins rauskomme usw.
    MFG Mipu

    3 Mal editiert, zuletzt von Optiimal ()