Szerző Téma: terület foglalás  (Megtekintve 627 alkalommal)

Nem elérhető inf

  • 366
    • Profil megtekintése
terület foglalás
« Dátum: 2014. Március 10. - 18:19:26 »
0 Show voters
Üdv.
Írtam egy terület foglalós scriptet de valahogy nem akar összejönni hogy villogjon amikor a játékos belép a zónába. Valaki átnézné a scriptem és elmondaná hogy mi a probléma vele?
Script:
 
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid == SzerverInfo[GangZone1Terulet])
    {
        if(SzerverInfo[GangZone1Team] != JatekosInfo[playerid][JatekMode])
        {
   SzerverInfo[GangZone1Join]++;
}
    }
    if(areaid == SzerverInfo[GangZone2Terulet])
    {
        if(SzerverInfo[GangZone2Team] != JatekosInfo[playerid][JatekMode])
        {
   SzerverInfo[GangZone2Join]++;
}
    }
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    if(areaid == SzerverInfo[GangZone1Terulet])
    {
        if(SzerverInfo[GangZone1Team] != JatekosInfo[playerid][JatekMode])
        {
           SzerverInfo[GangZone1Join]--;
}
    }
    if(areaid == SzerverInfo[GangZone2Terulet])
    {
        if(SzerverInfo[GangZone2Team] != JatekosInfo[playerid][JatekMode])
        {
           SzerverInfo[GangZone2Join]--;
}
    }
return 1;
}
public globaltimer()
{
    if(SzerverInfo[GangZone1Join] >= 2)
{
if(SzerverInfo[GangZone1Team] == 1)
    {
       GangZoneFlashForAll(SzerverInfo[GangZone1], 0xFF000090);
    }
    if(SzerverInfo[GangZone1Team] == 2)
    {
        GangZoneFlashForAll(SzerverInfo[GangZone1], 0x001EFF90);
    }
    if(SzerverInfo[GangZone1Timer] == 0)
    {
   SzerverInfo[GangZone1Count]=60;
}
SzerverInfo[GangZone1Timer]=1;
}
if(SzerverInfo[GangZone1Join] < 2)
{
GangZoneStopFlashForAll(SzerverInfo[GangZone1]);
SzerverInfo[GangZone1Timer]=0;
}
if(SzerverInfo[GangZone1Timer] == 1)
{
    SzerverInfo[GangZone1Count]--;
if(SzerverInfo[GangZone1Count] == 0)
{
    SzerverInfo[GangZone1Timer]=0;
    GangZoneStopFlashForAll(SzerverInfo[GangZone1]);
    if(SzerverInfo[GangZone1Team] == 1)
    {
       GangZoneShowForAll(SzerverInfo[GangZone1], 0xFF000090);
       SzerverInfo[GangZone1Team]=2;
    }
    if(SzerverInfo[GangZone1Team] == 2)
    {
        GangZoneShowForAll(SzerverInfo[GangZone1], 0x001EFF90);
        SzerverInfo[GangZone1Team]=1;
    }
}
}
return 1;
}
« Utoljára szerkesztve: 2014. Március 10. - 18:23:49 írta InFIeL_HuN »

terület foglalás
« Válasz #1 Dátum: 2014. Március 10. - 19:08:30 »
0 Show voters
GangZoneFlashForAll függvény használatával alapból villog a bandazóna nem kell hozzá idõzítõ!
Elöszõr GangZoneShowForAll utána GangZoneFlashForAll használd, és villógni fog a zóna.
« Utoljára szerkesztve: 2014. Március 10. - 19:11:27 írta bbTamas »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
terület foglalás
« Válasz #2 Dátum: 2014. Március 11. - 06:56:04 »
0 Show voters
Tessék, még egyszerüsítettem is neked ;)
 
public OnPlayerEnterDynamicArea(playerid, areaid) {
if(areaid == SzerverInfo[GangZone1Terulet] && SzerverInfo[GangZone1Team] != JatekosInfo[playerid][JatekMode]) SzerverInfo[GangZone1Join]++;
    if(areaid == SzerverInfo[GangZone2Terulet] && SzerverInfo[GangZone2Team] != JatekosInfo[playerid][JatekMode]) SzerverInfo[GangZone2Join]++;
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid) {
    if(areaid == SzerverInfo[GangZone1Terulet] && SzerverInfo[GangZone1Team] != JatekosInfo[playerid][JatekMode]) SzerverInfo[GangZone1Join]--;
    if(areaid == SzerverInfo[GangZone2Terulet] && SzerverInfo[GangZone2Team] != JatekosInfo[playerid][JatekMode]) SzerverInfo[GangZone2Join]--;
return 1;
}
public globaltimer() {
    if(SzerverInfo[GangZone1Join] >= 2) {
if(SzerverInfo[GangZone1Team] == 1) GangZoneFlashForAll(SzerverInfo[GangZone1], 0xFF000090);
if(SzerverInfo[GangZone1Team] == 2) GangZoneFlashForAll(SzerverInfo[GangZone1], 0x001EFF90);
        if(!SzerverInfo[GangZone1Timer]) SzerverInfo[GangZone1Count] = 60;
SzerverInfo[GangZone1Timer] = 1;
}
if(SzerverInfo[GangZone1Join] < 2) {
        GangZoneStopFlashForAll(SzerverInfo[GangZone1]);
        SzerverInfo[GangZone1Timer]=0;
}
if(SzerverInfo[GangZone1Timer] == 1) SzerverInfo[GangZone1Count]--;
     if(!SzerverInfo[GangZone1Count]) {
         SzerverInfo[GangZone1Timer] = 0;
         GangZoneStopFlashForAll(SzerverInfo[GangZone1]);
}
if(SzerverInfo[GangZone1Team] == 1) {
       GangZoneShowForAll(SzerverInfo[GangZone1], 0xFF000090);
GangZoneFlashForAll(SzerverInfo[GangZone1], 0xFF000090);
         SzerverInfo[GangZone1Team] = 2;
}
     if(SzerverInfo[GangZone1Team] == 2) {
         GangZoneShowForAll(SzerverInfo[GangZone1], 0x001EFF90);
GangZoneFlashForAll(SzerverInfo[GangZone1], 0x001EFF90);
        SzerverInfo[GangZone1Team] = 1;
     }
return 1;
}

Nem elérhető inf

  • 366
    • Profil megtekintése
terület foglalás
« Válasz #3 Dátum: 2014. Március 11. - 19:31:54 »
0 Show voters
Most már villog. Csak most meg már ezzel van a baj.
 
if(SzerverInfo[Zone2Team] == 2)
{
       GangZoneShowForAll(SzerverInfo[Zone2], 0x001EFF90);
       SzerverInfo[Zone2Team]=1;
}
if(SzerverInfo[Zone2Team] == 1)
{
       GangZoneShowForAll(SzerverInfo[Zone2], 0xFF000090);
       SzerverInfo[Zone2Team]=2;
}

 
Hogyha a terroristáké volt eddig a terület ( if(SzerverInfo[Zone2Team] == 2) ) akkor átállítja a terület szinét kékre és a terület ID-jét átállítja a katonákére. Csakhogyha átállítja a katonákéra akkor a következõ is le fog futni pedig az csak arra az esetre van ha a katonáké volt a terület és a terroristák foglalták el. Nah ezt kellene valahogy megoldani hogyha az elsõ if helyes akkor ne fusson tovább a másodikra.

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
terület foglalás
« Válasz #4 Dátum: 2014. Március 11. - 20:39:07 »
0 Show voters
Erre találták fel a többirányú elágazásokat.
 
if(SzerverInfo[Zone2Team] == 2)
{
       GangZoneShowForAll(SzerverInfo[Zone2], 0x001EFF90);
       SzerverInfo[Zone2Team]=1;
}
else if(SzerverInfo[Zone2Team] == 1)
{
       GangZoneShowForAll(SzerverInfo[Zone2], 0xFF000090);
       SzerverInfo[Zone2Team]=2;
}

Nem elérhető inf

  • 366
    • Profil megtekintése
terület foglalás
« Válasz #5 Dátum: 2014. Március 11. - 22:22:44 »
0 Show voters
Ez sem jó :(

Nem elérhető Dfoglalo

  • 4069
  • Globális Moderátor
    • Profil megtekintése
terület foglalás
« Válasz #6 Dátum: 2014. Március 11. - 23:36:39 »
0 Show voters
Akkor valamit elrontottál, mert ez jó :)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal