GangZone

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, :D
    ich habe mal eine Frage.
    Ich habe mir eben eine GangZone erstellt und fragte mich wie ich da z.B daraus eine Waffenfreie Zone machen könnte.
    Aber dadurch das ich nich weiß wie ich das machen soll wollte ich hier mal fragen.
    :wacko:

    Hier der Code von meiner GangZone:

    new Spawn;


    public OnGameModeInit() {
    Spawn = GangZoneCreate(-128,4566, 2335,575, 525,5044, 2674,233);
    return 1;
    }


    public OnPlayerSpawn(playerid) {
    GangZoneShowForPlayer(playerid, Spawn, 0x00FF0096);
    return 1;
    }

    Ich hoffe ihr könnt mir helfen.
    Danke schon mal im vorraus
    :thumbup:

  • Geht schon....


    mit ner if abfrage


    z.B:


    new waffenzone;
    ongamemodeinit:
    if(waffenzone = 1; {
    EnablePlayerWeapons();


    so i-wie weiß jetz ned genau...

  • Mom ich versuche es kann aber bissl dauern^^

  • Sry muss muss dich enttäuschen...


    Es währe Cool wenn jemand eine .inc entwickelt:
    IsPlayerInGangZone();

  • Ja Thx aber in welcher Include ist Das PlayerInArea?

  • Wo?

  • Haut einfach

    public isPlayerInArea()
    {
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
    GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
    if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37)
    /* This line is the important one!. Here, is where you change those numbers, by the ones
    you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
    doesnt matter*/
    {
    SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
    }
    }
    }



    rein und dann:

    if(isPlayerInArea(i, x,y,z)

  • stock IsPlayerInArea(playerid, Float:minX, Float:minY, Float:maxX, Float:maxY)
    {
    new Float:player_x, Float:player_y, Float:player_z;
    GetPlayerPos(playerid, player_x, player_y, player_z);
    if(player_x <= minX && player_x >= maxX && player_y <= minY && player_Y >= maxY) return 1;
    return 0;
    }



    /* Anwendungsbeispiel: */
    if(!strcmp(cmdtext,"/zonetest"))
    {
    if(IsPlayerInArea(playerid, 15.0, 16.0, 35.0, 22.0)) {
    print("It works");
    }
    else {
    print("Fail");
    }
    return 1;
    }

  • Och mano..
    Jetz hab ich da ganze zeit daran rum gemacht und dann....


    Inhalt anzeigen
    #include <a_samp>

    Inhalt anzeigen

    Inhalt anzeigen
    new Spawn;
    forward isPlayerInArea();

    Inhalt anzeigen

    Inhalt anzeigen

    Inhalt anzeigen
    public OnGameModeInit()
    {
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    Spawn = GangZoneCreate(-128.4566, 2335.575, 525.5044, 2674.233);
    SetTimer("isPlayerInArea",1000, 1);
    return 1;
    }

    Inhalt anzeigen

    Inhalt anzeigen
    public OnPlayerSpawn(playerid) {
    GangZoneShowForPlayer(playerid, Spawn, 0x00FF0096);
    return 1;
    }

    Inhalt anzeigen

    Inhalt anzeigen

    Inhalt anzeigen
    public isPlayerInArea()
    {
    new Float:X, Float:Y, Float:Z;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    GetPlayerPos(i, X, Y, Z);
    if (X <= - -128 && X >= -2335 && Y <= 525 && Y >= 2674)
    //-128.4566, 2335.575, 525.5044, 2674.233
    {
    ResetPlayerWeapons(1);
    }
    }
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
GangZone Seite 1 / 2