loh GW help

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 leute ich haben ne frage ich hab ein gw aber der geht nicht könnt mir helfen plsss









    //__________START__________//



    #define FILTERSCRIPT


    #include <a_samp>




    //__________FORWARDS_________//



    forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
    forward warover();
    forward IsPlayerInTurf(playerid);
    forward split(const strsrc[], strdest[][], delimiter);



    //___________END__________//




    //_________COLORS_____________//


    #define COLOR_GRAD1 0xB4B5B7FF
    #define COLOR_GRAD2 0xBFC0C2FF
    #define COLOR_GRAD3 0xCBCCCEFF
    #define COLOR_GRAD4 0xD8D8D8FF
    #define COLOR_GRAD5 0xE3E3E3FF
    #define COLOR_GRAD6 0xF0F0F0FF
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_GREEN 0x9EC73DAA
    #define COLOR_GROVE 0x00FF00FF
    #define COLOR_RED 0xAA3333AA
    #define red 0xFF0000AA
    #define green 0x33FF33AA
    #define dgreen 0x009000FF
    #define COLOR_COOLRED 0xB35959AA
    #define COLOR_ORANGE 0xFF9900AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_DARKRED 0x660000AA
    #define COLOR_JOIN 0x99FF9900
    #define COLOR_BRIGHTRED 0xFF0000AA
    #define COLOR_INDIGO 0x4B00B0AA
    #define COLOR_VIOLET 0x9955DEEE
    #define COLOR_GRAYWHITE 0xEEEEFFC4
    #define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
    #define COLOR_GREENISHGOLD 0xCCFFDD56
    #define COLOR_LIGHTBLUEGREEN 0x0FFDD349
    #define COLOR_NEUTRALBLUE 0xABCDEF01
    #define COLOR_LIGHTCYAN 0xAAFFCC33
    #define COLOR_LEMON 0xDDDD2357
    #define COLOR_LIGHTRED 0xFF6347AA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_LIGHTGREEN 0x9ACD32AA
    #define COLOR_YELLOW 0xDABB3EAA
    #define COLOR_YELLOW2 0xF5DEB3AA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_FADE1 0xE6E6E6E6
    #define COLOR_FADE2 0xC8C8C8C8
    #define COLOR_FADE3 0xAAAAAAAA
    #define COLOR_FADE4 0x8C8C8C8C
    #define COLOR_FADE5 0x6E6E6E6E
    #define COLOR_PURPLE 0xC2A2DAAA
    #define COLOR_CHAT1 0xF9B7FFAA
    #define COLOR_CHAT2 0xE6A9ECAA
    #define COLOR_CHAT3 0xC38EC7AA
    #define COLOR_CHAT4 0xD2B9D3AA
    #define COLOR_CHAT5 0xC6AEC7AA
    #define COLOR_ALLDEPT 0xFF8282AA
    #define COLOR_NEWS 0x458E1DAA
    #define COLOR_OOC 0xE0FFFFAA
    #define TEAM_CYAN 1
    #define TEAM_BLUE 2
    #define TEAM_GREEN 3
    #define TEAM_ORANGE 4
    #define TEAM_COR 5
    #define TEAM_BAR 6
    #define TEAM_TAT 7
    #define TEAM_CUN 8
    #define TEAM_STR 9
    #define TEAM_HIT 10
    #define TEAM_ADMIN 11
    #define OBJECTIVE_COLOR 0x64000064
    #define TEAM_GREEN_COLOR 0xFFFFFFAA
    #define TEAM_JOB_COLOR 0xFFB6C1AA
    #define TEAM_HIT_COLOR 0xFFFFFF00
    #define TEAM_BLUE_COLOR 0x8D8DFF00
    #define TEAM_RADIO_COLOR 0xF2D068FF
    #define COLOR_ADD 0x63FF60AA
    #define TEAM_GROVE_COLOR 0x00D900C8
    #define TEAM_VAGOS_COLOR 0xFFC801C8
    #define TEAM_BALLAS_COLOR 0xD900D3C8
    #define TEAM_AZTECAS_COLOR 0x01FCFFC8
    #define TEAM_CYAN_COLOR 0xFF8282AA
    #define COLOR_CREAM 0xFF8282AA
    #define TEAM_ORANGE_COLOR 0xFF830000
    #define TEAM_COR_COLOR 0x39393900
    #define TEAM_BAR_COLOR 0x00D90000
    #define TEAM_TAT_COLOR 0xBDCB9200
    #define TEAM_CUN_COLOR 0xD900D300
    #define TEAM_STR_COLOR 0x01FCFF00
    #define TEAM_ADMIN_COLOR 0x00808000
    #define COLOR_SIMPSONS 0xFFD90FAA
    #define COLOR_SEA 0x00808000
    #define COLOR_INVIS 0xAFAFAF00
    #define COLOR_SPEC 0xBFC0C200
    // GangZone Colors
    #define COLOR_ERROR 0xFB0000FF
    #define COLOR_MSG 0xFFFFFF00
    #define BLACK1 0x000000C7
    #define WHITE1 0xFFFFFFBE
    #define ORANGE1 0xFF8000B8
    #define RED1 0xFF0000C7
    #define BLUE1 0x0000FFC5
    #define VIOLET1 0x8000FFC9
    #define GREEN1 0x00FF00D0
    #define YELLOW1 0xFFFF00CC
    #define PINK1 0xFF80FFC7
    #define SEABLUE1 0x5BB9E6CA
    #define BROWN1 0x562C2CD2



    //_______________________________________//




    #define MAX_GANGZONE 3
    #define GANGZONE_FILE_PATH "gangzone.ini"
    enum gzInfo
    {
    gzOwned,
    Float:gzX,
    Float:gzY,
    Float:gzZ,
    };
    new GangZoneInfo[MAX_GANGZONE][gzInfo];





    new Grove_Street;
    new Ballaz_Gang;
    new Garage_Gang;




    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" ");
    print("--------------------------------------\n");
    LoadGangZones();
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/gw", true) == 0)
    {
    if(IsPlayerInTurf(playerid))
    {
    if (PlayerToPoint(3, playerid, 2533.0771,-1664.6176,15.1666))
    {
    Grove_Street = GangZoneCreate(2425.363, -1733.182, 2524.237, -1634.489);
    SaveGangZones();
    GangZoneShowForPlayer(playerid, Grove_Street, 0x00FF00D0);
    GangZoneFlashForAll(playerid, 0xAA3333AA);
    SetTimer("warover", 600000, 0);
    }
    if (PlayerToPoint(3, playerid, 2019.9958,-1094.6997,24.5887))
    {
    Ballaz_Gang = GangZoneCreate(1873.952, -1267.349, 2075.502, -1097.596);
    SaveGangZones();
    GangZoneShowForPlayer(playerid, Ballaz_Gang, 0xFF00FF96);
    GangZoneFlashForAll(playerid, 0xAA3333AA);
    SetTimer("warover", 600000, 0);
    }
    if (PlayerToPoint(3, playerid, 2323.5935,-1254.1749,22.5000))
    {
    Garage_Gang = GangZoneCreate(2303.672, -1287.088, 2345.503, -1168.656);
    SaveGangZones();
    GangZoneShowForPlayer(playerid, Garage_Gang, 0xFF800096);
    GangZoneFlashForAll(playerid, 0xAA3333AA);
    SetTimer("warover", 600000, 0);
    }



    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, " ** Du bist nicht an einer Übernahme vor Ort ! **");
    return 1;
    }


    }
    return 0;
    }





    //___________________________DON'T EDIT THIS_________________________//


    public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
    {
    if(IsPlayerConnected(playerid))
    {
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
    return 1;
    }
    }
    return 0;
    }



    //________________________END______________________________________//



    //_________________YOU CAN EDIT THIS_____________________________________________//


    public warover()
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    SendClientMessageToAll(COLOR_RED, " ** Der Rasen wurde gefangen ! "); // This will show's everyone the message that the turf has been captured
    GivePlayerMoney(i, 50000); // The money the player will get after getting the turf
    SendClientMessage(i, COLOR_GREEN, " Sie schaffte es, weg mit $ 50.000 und ein paar Kanonen !"); // The message
    GivePlayerWeapon(i, 23, 80); // The wepeaon the player will get
    GivePlayerWeapon(i, 28, 2000); // Another weapon the player will get
    GangZoneDestroy(Grove_Street); // It will destroy the gangzone
    GangZoneDestroy(Garage_Gang); // ;;
    GangZoneDestroy(Ballaz_Gang);// ;;
    }
    }


    //__________If Player is in turf pickup_________//


    public IsPlayerInTurf(playerid)
    {
    if(IsPlayerConnected(playerid))
    {


    if (PlayerToPoint(3, playerid, 2533.0771,-1664.6176,15.1666))
    {
    return true;
    }
    else if (PlayerToPoint(3, playerid, 2019.9958,-1094.6997,24.5887))
    {
    return true;
    }
    else if (PlayerToPoint(3, playerid, 2323.5935,-1254.1749,22.5000))
    {
    return true;
    }
    }
    return 0;
    }



    //_____________DON'T EDIT___________//


    forward LoadGangZones();
    public LoadGangZones()
    {
    new gzOption[4][65], string[128];
    new File: file = fopen(GANGZONE_FILE_PATH, io_read);
    if(file)
    {
    new idx;
    while(idx < sizeof(GangZoneInfo))
    {
    fread(file, string);
    split(string, gzOption, '|');
    GangZoneInfo[idx][gzOwned] = strval(gzOption[0]);
    GangZoneInfo[idx][gzX] = floatstr(gzOption[1]);
    GangZoneInfo[idx][gzY] = floatstr(gzOption[2]);
    GangZoneInfo[idx][gzZ] = floatstr(gzOption[3]);
    idx++;
    }
    fclose(file);
    }
    return 1;
    }
    forward SaveGangZones();
    public SaveGangZones()
    {
    new idx, string[256];
    new File: file;
    idx = 0;
    while(idx < sizeof(GangZoneInfo))
    {
    format(string, sizeof(string), "%d|%f|%f|%f\r\n",
    GangZoneInfo[idx][gzOwned],
    GangZoneInfo[idx][gzX],
    GangZoneInfo[idx][gzY],
    GangZoneInfo[idx][gzZ]);
    if(idx == 0) file = fopen(GANGZONE_FILE_PATH, io_write);
    else file = fopen(GANGZONE_FILE_PATH, io_append);
    fwrite(file, string);
    idx++;
    fclose(file);
    }
    return 1;
    }
    public split(const strsrc[], strdest[][], delimiter)
    {
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc)){
    if(strsrc==delimiter || i==strlen(strsrc)){
    len = strmid(strdest[aNum], strsrc, li, i, 128);
    strdest[aNum][len] = 0;
    li = i+1;
    aNum++;
    }
    i++;
    }
    return 1;
    }