Ich hab ein Problem im Script

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
  • Ich hab ein Problem...bei dem befehl /m



    und meine frage ist....oder eher mien problem...man kann diesen befehl überall nutzen und zb. nicht nur im copcar -.-


    weiß jemand woran das liegen kann?


    danke für eine antwort ...


    mfg wetze789

  • http://easymesut.pastebin.com/9ScqyzYc


    Kannst auch leicht hinzufügen:
    /*if(!IsACopCar(tmpcar))
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nich im Polizei Auto !");
    return 1;
    }*/

  • Hier nimm meinen.Der sollte eigentlich funktionieren.(Bei mir funzt es jedenfalls nur in nem CopCar)



    if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Tippe: (/m)egaphone [megaphone chat]");
    return 1;
    }
    if(gTeam[playerid] == 2 || IsACop(playerid) || IsAnFbiCar(playerid) || IsAOamt(playerid))
    {
    if(IsACopCar(tmpcar) || IsAnFbiCar(tmpcar) || IsAOamtCar(tmpcar) || IsAZollCar(tmpcar))
    {
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
    {
    new currank[64];
    if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
    else if(PlayerInfo[playerid][pRank] == 2) { currank = "Police Officer"; }
    else if(PlayerInfo[playerid][pRank] == 3) { currank = "Corporal"; }
    else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
    else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
    else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
    else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
    else if(PlayerInfo[playerid][pRank] == 8) { currank = "Direktor"; }
    else { currank = "Cadet"; }
    format(string, sizeof(string), "[%s %s:o< %s]", currank, sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
    {
    format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else if(PlayerInfo[playerid][pMember] == 17||PlayerInfo[playerid][pLeader] == 17)
    {
    format(string, sizeof(string), "[Oamtler %s:o< %s]", sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else if(PlayerInfo[playerid][pMember] == 18||PlayerInfo[playerid][pLeader] == 18)
    {
    format(string, sizeof(string), "[Zollbeamter %s:o< %s]", sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    printf("%s", string);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht in einem Polizeiauto!");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Beamter!");
    return 1;
    }
    }
    return 1;
    }


    Falls du damit noch Probleme hast,schreib mich an ;)
    Hoffe ich konnte dir mit meinem Befehl helfen!
    Mfg
    [FoR]Hardcore


    P.s Du musst den Befehl vieleicht noch an dein Script anpassen!

  • if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Tippe: (/m)egaphone [megaphone chat]");
    return 1;
    }
    if(gTeam[playerid] == 2)
    {
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
    {
    new currank[64];
    if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
    else if(PlayerInfo[playerid][pRank] == 2) { currank = "Police Officer"; }
    else if(PlayerInfo[playerid][pRank] == 3) { currank = "Corporal"; }
    else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
    else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
    else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
    else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
    else if(PlayerInfo[playerid][pRank] == 8) { currank = "Direktor"; }
    else { currank = "Cadet"; }
    format(string, sizeof(string), "[%s %s:o< %s]", currank, sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
    {
    format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else if(PlayerInfo[playerid][pMember] == 17||PlayerInfo[playerid][pLeader] == 17)
    {
    format(string, sizeof(string), "[Oamtler %s:o< %s]", sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else if(PlayerInfo[playerid][pMember] == 18||PlayerInfo[playerid][pLeader] == 18)
    {
    format(string, sizeof(string), "[Zollbeamter %s:o< %s]", sendername, result);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    printf("%s", string);
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Beamter!");
    return 1;
    }
    }
    return 1;
    }

    Mfg. BlackFoX_UD_ alias [BFX]Explosion