Entbannen-Befehl und /duty problem!!

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,


    hab mir ein fertiges reallife script gedownloaded und bin beschäftigt, es zu überarbeiten.




    2 probleme musste ich leider feststellen:




    es gibt keinen (funktionierenden) entbann-befehl


    und ein problem gibt es bei /duty für LSPD cops, es steht immer "Du bist kein Beamter"!




    zum 1., hätte jmd einen code dafür? bin noch ziemlich neu im scripten und weiß daher nicht welche cmds verwendet werden sollen...


    und noch ne frage, wie kann ich nen ip-bann rückgängig machen?




    und zu 2.


    hier wäre der quellcode:





    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(OnDuty[playerid]==0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if (PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerInfo[playerid][pLocal] != 255)
    {
    PreviousSkin[playerid] = GetPlayerSkin(playerid);
    format(string, sizeof(string), "* %s begibt sich nun als Polizist in den Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(PlayerInfo[playerid][pSex] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 1) { SetPlayerSkin(playerid, 71); }
    else if(PlayerInfo[playerid][pRank] == 2) { SetPlayerSkin(playerid, 280); }
    else if(PlayerInfo[playerid][pRank] == 3) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 4) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 5) { SetPlayerSkin(playerid, 267); }
    else if(PlayerInfo[playerid][pRank] == 6) { SetPlayerSkin(playerid, 281); }
    else if(PlayerInfo[playerid][pRank] == 7) { SetPlayerSkin(playerid, 265); }
    else if(PlayerInfo[playerid][pRank] == 8) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 9) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 10) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 11) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 12) { SetPlayerSkin(playerid, 288); }
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
    SetPlayerSkin(playerid, 192);
    }
    GivePlayerWeapon(playerid, 3, 1);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 29, 700);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    OnDuty[playerid] = 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
    }
    }
    }
    else if(OnDuty[playerid] == 1)
    {


    if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(10,playerid,234.8921,111.8931,1003.2257) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, sendername, sizeof(plname));
    format(string, sizeof(string), "* Beamter %s legt Uniform in seinen Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerSkin(playerid, PreviousSkin[playerid]);
    ResetPlayerWeapons(playerid);
    SetPlayerToTeamColor(playerid);
    SetPlayerArmour(playerid, 0);
    OnDuty[playerid] = 0;
    }
    }
    }





    DIE 8) smilies sind 8ten und )-klammern!!!!!!!





    mfg jackpot

  • Zu dem /duty:
    Mach das mal bitte in einen PWN Code. Also oben anklicken und dann halt einfügen;)
    Zu dem Entbannen. Das geht nur für nen IP-Ban. Es sei denn du arbeitest mit MySQL.
    Also meines Erachtens nach.

  • if(strcmp(cmd, "/duty", true) == 0)
    {
    if(OnDuty[playerid]==0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if (PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerInfo[playerid][pLocal] != 255)
    {
    PreviousSkin[playerid] = GetPlayerSkin(playerid);
    format(string, sizeof(string), "* %s begibt sich nun als Polizist in den Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(PlayerInfo[playerid][pSex] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 1) { SetPlayerSkin(playerid, 71); }
    else if(PlayerInfo[playerid][pRank] == 2) { SetPlayerSkin(playerid, 280); }
    else if(PlayerInfo[playerid][pRank] == 3) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 4) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 5) { SetPlayerSkin(playerid, 267); }
    else if(PlayerInfo[playerid][pRank] == 6) { SetPlayerSkin(playerid, 281); }
    else if(PlayerInfo[playerid][pRank] == 7) { SetPlayerSkin(playerid, 265); }
    else if(PlayerInfo[playerid][pRank] == 8) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 9) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 10) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 11) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 12) { SetPlayerSkin(playerid, 288); }
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
    SetPlayerSkin(playerid, 192);
    }
    GivePlayerWeapon(playerid, 3, 1);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 29, 700);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    OnDuty[playerid] = 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du kannst hier nicht Duty gehen!");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
    }
    }
    else if(OnDuty[playerid] == 1 && (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2))
    {


    if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(10,playerid,234.8921,111.8931,1003.2257) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, sendername, sizeof(plname));
    format(string, sizeof(string), "* Beamter %s legt Uniform in seinen Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerSkin(playerid, PreviousSkin[playerid]);
    ResetPlayerWeapons(playerid);
    SetPlayerToTeamColor(playerid);
    SetPlayerArmour(playerid, 0);
    OnDuty[playerid] = 0;
    }
    }
    }


    Es sollte eig. jetzt funktionieren.


    MfG
    luckyguy

  • @lucky: danke, werds testen :thumbup:



    @scriptor: wie meinst du das? kann ich nur mit mysql einen accout-unban erstellen?


    wenn ja, kann ich das in meinem script dann einfügen?


    ?(




    mfg