/duty in Copcars

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
  • if(strcmp(cmd, "/dienst", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 18)
    {
    if (PlayerToPoint(3.0,playerid,217.7090,185.7917,1003.0313) || PlayerToPoint(3.0,playerid,255.3710,77.1289,1003.6406))
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Uniform und seine Waffen aus dem Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 24, 250);
    GivePlayerWeapon(playerid, 3, 0);
    GivePlayerWeapon(playerid, 29, 250);
    GivePlayerWeapon(playerid, 31, 250);
    SetPlayerHealth(playerid,100);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Uniform und seine Waffen in den Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 23, 150);
    GivePlayerWeapon(playerid, 5, 0);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Umkleidungsraum!");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if (PlayerToPoint(6, playerid,217.7090,185.7917,1003.0313))
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Uniform und seine Waffen aus dem Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 24, 250);
    GivePlayerWeapon(playerid, 3, 0);
    GivePlayerWeapon(playerid, 29, 250);
    GivePlayerWeapon(playerid, 31, 250);
    SetPlayerHealth(playerid,100);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Uniform und seine Waffen in den Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 23, 150);
    GivePlayerWeapon(playerid, 5, 0);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Umkleidungsraum!");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Offduty!");
    JobDuty[playerid] = 0;
    Medics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Onduty!");
    JobDuty[playerid] = 1;
    Medics += 1;
    }
    }
    else if(PlayerInfo[playerid][pJob] == 7)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Offduty!");
    JobDuty[playerid] = 0;
    Mechanics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Onduty!");
    JobDuty[playerid] = 1;
    Mechanics += 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist kein Verbrechensjäger!");
    }
    }
    return 1;
    }

  • if(strcmp(cmd, "/dienst", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 18)
    {
    if(IsPlayerInVehicle(playerid))
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Uniform und seine Waffen aus dem Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 24, 250);
    GivePlayerWeapon(playerid, 3, 0);
    GivePlayerWeapon(playerid, 29, 250);
    GivePlayerWeapon(playerid, 31, 250);
    SetPlayerHealth(playerid,100);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Uniform und seine Waffen in den Kofferraum.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 23, 150);
    GivePlayerWeapon(playerid, 5, 0);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Fahrzeug");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if (Is
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "%s nimmt seine Uniform und seine Waffen aus dem Kofferraum", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 24, 250);
    GivePlayerWeapon(playerid, 3, 0);
    GivePlayerWeapon(playerid, 29, 250);
    GivePlayerWeapon(playerid, 31, 250);
    SetPlayerHealth(playerid,100);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "%s legt seine Uniform und seine Waffen in den Kofferraum", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 23, 150);
    GivePlayerWeapon(playerid, 5, 0);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht in einem Fahrzeug");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Offduty!");
    JobDuty[playerid] = 0;
    Medics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Onduty!");
    JobDuty[playerid] = 1;
    Medics += 1;
    }
    }
    else if(PlayerInfo[playerid][pJob] == 7)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Offduty!");
    JobDuty[playerid] = 0;
    Mechanics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du bist nun Onduty!");
    JobDuty[playerid] = 1;
    Mechanics += 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist kein Verbrechensjäger!");
    }
    }
    return 1;
    }


    Musste mal versuchen, weiß aber nicht genau ^^