Duty Befehl.

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,


    Ich habe ein duty Befehl für Cops über ocmd gemacht.
    Wie mache ich das jetzt das in einem bestimmten Umkreis vom Point eine Naricht bekommt: %s nimmt seine Ausrüstung und sein Abzeichen aus dem Schranck und geht in den Dienst?


    Gruß


    Hier der Befehel:


    ocmd:duty(playerid,params[])
    {
    if(!isPlayerInFrakt(playerid,1))return SendClientMessage(playerid,Grau,"Du bist kein Beamter.");
    if(!IsPlayerInRangeOfPoint(playerid,5.0,254.6810,77.1243,1003.6406)) return SendClientMessage(playerid,Grau, "Du bist nicht in der Umkleide.");
    GivePlayerWeapon(playerid,31,200);
    GivePlayerWeapon(playerid,24,100);
    GivePlayerWeapon(playerid,3,1);
    SetPlayerColor(playerid,BLAU);
    SendClientMessage(playerid, COLOR_GREY, "Du bist nun im Dienst!");
    return 1;
    }

  • mit
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "* %s nimmt seine Ausrüstung und sein Abzeichen aus dem Schranck und geht in den Dienst.", pName);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);



    ich benutze dazu ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) liegt auch daran das ich gerade mein altes SoL script umscripte


    public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
    {
    if(IsPlayerConnected(playerid))
    {
    new Float:posx, Float:posy, Float:posz;
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    //radi = 2.0; //Trigger Radius
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(!BigEar[i])
    {
    GetPlayerPos(i, posx, posy, posz);
    tempposx = (oldposx -posx);
    tempposy = (oldposy -posy);
    tempposz = (oldposz -posz);
    //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
    {
    SendClientMessage(i, col1, string);
    }
    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
    {
    SendClientMessage(i, col2, string);
    }
    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
    {
    SendClientMessage(i, col3, string);
    }
    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
    {
    SendClientMessage(i, col4, string);
    }
    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
    SendClientMessage(i, col5, string);
    }
    }
    else
    {
    SendClientMessage(i, col1, string);
    }
    }
    }
    }//not connected
    return 1;
    }