Hilfe: OCMD 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
  • Hallo Community,


    habe mir eben den ersten ocmd Befehl erstellt, und möchte den nur für eine Fraktion (LSPD) freischalten.


    Wie mache ich das im Script?


    ocmd:lspdauf(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,10,1544.7, -1631, 14.2))return SendClientMessage(playerid,COLOR_RED,"Du bist nicht in der Nähe vom Tor.");
    MoveObject(torlspd,1544.7, -1631, 14.2-10,5);
    return 1;
    }


    Für Hilfe wäre ich sehr dankbar :)

  • if(strcmp(cmd, "/tazer", true) ==0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gTeam[playerid] == 2 || IsACop(playerid))
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !");
    return 1;
    }
    new suspect = GetClosestPlayer(playerid);
    if(IsPlayerConnected(suspect))
    {
    if(PlayerCuffed[suspect] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " Player already Cuffed !");
    return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
    {
    if(gTeam[suspect] == 2)
    {
    SendClientMessage(playerid, COLOR_GREY, " Cannot Tazer Cops / FBI / National Guard !");
    return 1;
    }
    if(IsPlayerInAnyVehicle(suspect))
    {
    SendClientMessage(playerid, COLOR_GREY, " Suspect is in a Car, get him out first !");
    return 1;
    }
    GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* You were Tazed by %s for 8 seconds.", sendername);
    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* You Tazed %s for 8 seconds.", giveplayer);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* %s shoots with his Tazer at %s, and tazed him.", sendername ,giveplayer);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GameTextForPlayer(suspect, "~r~Tazed", 2500, 3);
    TogglePlayerControllable(suspect, 0);
    PlayerCuffed[suspect] = 1;
    PlayerCuffedTime[suspect] = 8;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " No-one near you!");
    return 1;
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !");
    }
    }//not connected
    return 1;
    }



    Meinst du das z.b.??

  • Schreib deinen Tor Befehl bitte so.
    ocmd:lspdauf(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,10,1544.7, -1631, 14.2))return SendClientMessage(playerid,COLOR_RED,"Du bist nicht in der Nähe vom Tor.");
    if(gTeam[playerid] == 2 || IsACop(playerid))
    {
    MoveObject(torlspd,1544.7, -1631, 14.2-10,5);
    }
    return 1;
    }


    Homez 8)