Duty bei LoH ändern - Bekomme Errors

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 Breadfish.


    Ich wollte heute mal wissen, wie ich den CMD /duty im LoH 0.4 so ändern kann, dass es das FBI extra machen kann.


    Hier der CMD:



    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsACop(playerid))
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,227.6519,111.8072,1003.2188) ||IsPlayerInRangeOfPoint(playerid,3.0,255.3,77.4,1003.6)
    || IsPlayerInRangeOfPoint(playerid,3.0,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(playerid,3.0, 217.5230,184.4352,1003.0313)
    || IsPlayerInRangeOfPoint(playerid,3.0, 217.8921,78.9727,1005.0391)
    || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* Officer %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 41, 500); //spray
    GivePlayerWeapon(playerid, 3, 1); //Nightstick
    GivePlayerWeapon(playerid, 25, 100); //Shotgun
    GivePlayerWeapon(playerid, 24, 500); //Desert Eagle
    GivePlayerWeapon(playerid, 29, 500); //MP5
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "* Officer %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(giveplayerid);
    PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
    PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
    PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
    PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keiner Umkleide !");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,-1706.6536,1017.7665,17.5859))
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* FBI-Agent %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 41, 500); //spray
    GivePlayerWeapon(playerid, 3, 0); //Nightstick
    GivePlayerWeapon(playerid, 25, 100); //Shotgun
    GivePlayerWeapon(playerid, 24, 500); //Desert Eagle
    GivePlayerWeapon(playerid, 29, 500); //MP5
    GivePlayerWeapon(playerid, 33, 50); //County Rifle
    OnDuty[playerid] = 1;
    }

    Ich habe jetzt nur das 'wichtigste' genommen.


    Folgendes soll geändert werden:
    if(IsACop(playerid)) zu if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1) || if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
    Nur ich bekomme immer Errors. Warum?
    Ich hoffe., dass ich mir helfen könnt.
    MFG Home


    /edit: Überschrift geändert

  • Kann es evtl. daran liegen:

    || if(PlayerInfo

    Wenn ja: Was muss ich ändern?

  • Also so muss ich es ändern um (evtl.) keine Errors zu bekommen?
    Probiere es mal aus und melde mich gleich wieder
    /edit: Danke Ink hat gefunzt :D
    /edit 2: Wenn ich jetzt aber als FBI /duty eingebe kommt "Du bist in Keiner Umkleide", obwohl ich da bin.
    Kann mir jetzt jemand weiterhelfen?



    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,227.6519,111.8072,1003.2188) ||IsPlayerInRangeOfPoint(playerid,3.0,255.3,77.4,1003.6)
    || IsPlayerInRangeOfPoint(playerid,3.0,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(playerid,3.0, 217.5230,184.4352,1003.0313)
    || IsPlayerInRangeOfPoint(playerid,3.0, 217.8921,78.9727,1005.0391)
    || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* Officer %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 41, 500); //spray
    GivePlayerWeapon(playerid, 3, 1); //Nightstick
    GivePlayerWeapon(playerid, 25, 100); //Shotgun
    GivePlayerWeapon(playerid, 24, 500); //Desert Eagle
    GivePlayerWeapon(playerid, 29, 500); //MP5
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "* Officer %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(giveplayerid);
    PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
    PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
    PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
    PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keiner Umkleide !");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,-1706.6536,1017.7665,17.5859))
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* FBI-Agent %s nimmt seine Marke aus dem Schrank und meldet sich zum Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 41, 100000000); //spray
    GivePlayerWeapon(playerid, 3, 0); //Nightstick
    GivePlayerWeapon(playerid, 27, 100000000); //Shotgun
    GivePlayerWeapon(playerid, 24, 100000000); //Desert Eagle
    GivePlayerWeapon(playerid, 29, 100000000); //MP5
    GivePlayerWeapon(playerid, 34, 100000000); //County Rifle
    GivePlayerWeapon(playerid, 31, 100000000); //M4
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100.0);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "* FBI-Agent %s legt seine Marke in den Schrank und macht Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(giveplayerid);
    PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
    PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
    PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
    PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keiner Umkleide !");
    return 1;
    }
    }

    Einmal editiert, zuletzt von Homerun ()

  • Nein ganz sicher nicht. Wenn ich FBI bin kann ich im PD nicht duty gehen (was ich als LSPD oder SFPD kann)