Beiträge von DasDimaHD

    Sry dass es gso Lange gedauert hat^^
    Function GetClosestPlayer(p1)
    {
    new x,Float:dis,Float:dis2,player;
    player = -1;
    dis = 99999.99;
    for (x=0;x<MAX_PLAYERS;x++)
    {
    if(IsPlayerConnected(x))
    {
    if(x != p1)
    {
    dis2 = GetDistanceBetweenPlayers(x,p1);
    if(dis2 < dis && dis2 != -1.00)
    {
    dis = dis2;
    player = x;
    }
    }
    }
    }
    return player;

    new suspect = GetClosestPlayer(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /arrest (ID / Name)");
    return 1;
    }

    Function IsACop(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    new leader = PlayerInfo[playerid][pLeader];
    new member = PlayerInfo[playerid][pMember];
    if(member==1 || member==2 || member==22 || member==3)
    {
    return 1;
    }
    else if(leader==1 || leader==2 || leader==22 || leader==3)
    {
    return 1;
    }
    }
    return 0;
    }

    Wenn ich /arrest ID mache dann steht da
    Du kannst keinen Beamten einsperren!
    Aber der ist kein Cop.
    Hier ist der Pawn Code:



    if(strcmp(cmd, "/arrest", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Dienst!");
    return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid,6.0, 1564.5873,-1694.4680,5.8906) || IsPlayerInRangeOfPoint(playerid,3.0,268.5958,85.1651,1001.0391) || IsPlayerInRangeOfPoint(playerid,3.0,-1702.6952,1017.9680,17.5859))
    {// Jail spot
    new suspect = GetClosestPlayer(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /arrest (ID / Name)");
    return 1;
    }
    if(IsACop(suspect))
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du kannst keinen Beamten einsperren!");
    return 1;
    }
    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, " Der Spieler ist nicht gesucht!");
    return 1;
    }
    GivePlayerMoney(suspect,-WantedLevel[suspect]*750);
    GivePlayerMoney(playerid,WantedLevel[suspect]*750);
    PlayerInfo[playerid][pGehalt] += WantedLevel[suspect]*2000;
    ResetPlayerWeapons(suspect);
    if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
    {
    format(string, sizeof(string), "INFO: Officer %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
    OOCNews(COLOR_RED, string);
    }
    else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
    {
    format(string, sizeof(string), "INFO: Agent %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
    OOCNews(COLOR_RED, string);
    }
    else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
    {
    format(string, sizeof(string), "INFO: Soldat %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
    OOCNews(COLOR_RED, string);
    }
    else if(PlayerInfo[playerid][pMember]==22||PlayerInfo[playerid][pLeader]==22)
    {
    format(string, sizeof(string), "INFO: SWAT Agent %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
    OOCNews(COLOR_RED, string);
    }
    if(LSPDZellen == 0)//zelle1
    {
    SetPlayerInterior(suspect, 6);
    UnFreezePlayer(suspect);
    PlayerCuffed[suspect] = 0;
    SetPlayerPos(suspect,264.0306,82.5047,1001.0391);
    LSPDZellen += 1;
    }
    if(LSPDZellen == 1)//zelle2
    {
    SetPlayerInterior(suspect, 6);
    UnFreezePlayer(suspect);
    PlayerCuffed[suspect] = 0;
    SetPlayerPos(suspect,263.5588,86.7332,1001.0391);
    LSPDZellen += 1;
    }
    if(LSPDZellen == 2)//zelle3
    {
    SetPlayerInterior(suspect, 6);
    UnFreezePlayer(suspect);
    PlayerCuffed[suspect] = 0;
    SetPlayerPos(suspect,263.5588,86.7332,1001.0391);
    LSPDZellen = 0;
    }
    PlayerInfo[suspect][pJailTime] = WantedLevel[suspect] * 240;
    new spr[100];
    format(spr,sizeof(spr),"Du wurdest für %d Minuten und einer Geldstrafe von %d$ eingesperrt",WantedLevel[suspect] * 4,WantedLevel[suspect] * 2000);
    SendClientMessage(playerid,COLOR_LIGHTBLUE,spr);
    PlayerInfo[suspect][pJailed] = 1;
    PlayerInfo[suspect][pArrested] += 1;
    SetPlayerInterior(suspect, 6);
    SetPlayerFree(suspect,playerid, "Verhaftet");
    WantedPoints[suspect] = 0;
    WantedLevel[suspect] = 0;
    SetPlayerWantedLevel(suspect,0);
    }//distance
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Niemand zum Verhaften in deiner Nähe.");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter !");
    return 1;
    }
    }//not connected
    return 1;
    }

    @PuSchKiiN_x3

    Zitat

    Zeig mal 10zeilen vor & nach denn GS Autos :)


    HitmanVehs[12] = AddStaticVehicleEx(487,1889.8123,651.8834,19.0740,0.0000,0,0,-1); // Maverick
    for(new v;v< sizeof(HitmanVehs);v++)

    MedicVehs[0] = AddStaticVehicleEx(560,1093.5000000,-1319.1999512,13.5000000,268.0000000,3,1,-1); //Sultan
    MedicVehs[1] = AddStaticVehicleEx(560,1093.5999756,-1315.6999512,13.5000000,267.9949951,3,1,-1); //Sultan
    for(new v;v< sizeof(MedicVehs);v++)

    oAmtVehs[0] = AddStaticVehicleEx(560,2279.3000488,2062.8000488,10.6000004,180.0000000,128,6,-1); //Sultan
    oAmtVehs[1] = AddStaticVehicleEx(560,2283.3999023,2062.8000488,10.6000004,180.0000000,128,6,-1); //Sultan
    for(new v;v< sizeof(oAmtVehs);v++)


    Simon

    Der geht anscheinend die shcleife durch und erstellt jedes Auto mal die Anzahl aller Autos:


    Bei 10 GS Autos macht er 10*10 also 100 Autos, fügst du eins hinzu würde er 11'11 also 121 machen.


    Nehm die schleife raus oder schreib es ein wenig überishctlicher mit enum und variable und geh dann die forschleife durch und erstelle die autos.


    Wo ist die Schleife?

    Ich habe ein großes Problem
    Bei manchen Fraktionen sind viele Fahrzeuge übereinander gestappelt,
    Ich nehme als Beispiel jetzt GS


    Screen:
    http://imageshack.us/f/842/samp016gw.png/


    Code:


    GroveVehs[0] = AddStaticVehicleEx(560,2516.3828,-1672.2086,13.6008,59.2683,86,86,-1);
    GroveVehs[1] = AddStaticVehicleEx(560,2504.7471,-1680.6157,13.1672,313.6806,86,86,-1);
    GroveVehs[2] = AddStaticVehicleEx(522,2512.2380,-1687.2024,13.1452,47.7534,86,86,-1);
    GroveVehs[3] = AddStaticVehicleEx(522,2509.6218,-1688.5973,13.1140,48.9373,86,86,-1);
    GroveVehs[4] = AddStaticVehicleEx(451,2491.4182,-1684.0216,13.1254,269.1117,86,86,-1);
    GroveVehs[5] = AddStaticVehicleEx(541,2486.4944,-1654.0997,13.0229,88.8405,86,86,-1);
    GroveVehs[6] = AddStaticVehicleEx(487,2531.2183,-1677.5094,20.1066,92.5026,86,86,-1);
    GroveVehs[7] = AddStaticVehicleEx(468,2518.3711,-1664.3739,13.8233,92.2982,86,86,-1);
    GroveVehs[8] = AddStaticVehicleEx(468,2518.4358,-1667.6611,13.9745,90.1251,86,86,-1);
    GroveVehs[9] = AddStaticVehicleEx(409,2473.5012,-1696.6276,13.3146,1.1739,86,86,-1);
    for(new v;v< sizeof(GroveVehs);v++)
    Hoffe ihr könnt mir Helfen,
    MFG DasDimaLP