Warring + Problem

Započeo Zivkovic, Jul 26, 2021, 02:42:13 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Imam smrdljivi warring mnogo me zajebava i smeta mi da ga gledam na oci vise :( , nakon toga imam problem sa crvenom zonom kada idete /crvenazona sve lepo kupite zajebavate se sve top cik cak i onda kad zavrsite vam u  stats pise koliko imate kilova i na leadboard i ne sacuva se kada opet udjete u crvenu zonu na td dole se promeni sve na 0 ali u stats isto a ja ocu u stats da ostane koliko imam kilova i smrti da bi ostao na leadboard  8)
Deo skripte:  [pawn]#define ZIMSKI_MOD 0[/pawn]
C:\Users\PC\Desktop\Bs\gamemodes\bs1.0.pwn(1698) : warning 201: redefinition of constant/macro (symbol "ZIMSKI_MOD")

================================================
//crvena

[pawn]enum czData
{
   Float:czPos[4],
   czNagrada[5],
   Float:czpPos[3],
   //temp
   czLabel,
   czPickup,
   czZona,
   czDynamicArea
}

new CZ[ czData ];

new Text:CZ_TD[14];
new PlayerText:CZ_PTD[MAX_PLAYERS][3];

new Float:CZSpawns[5][3] =
{
   { 2593.6819, -2378.5083, 15.0407 },
   { 2595.7878, -2380.8240, 13.5134 },
   { 2577.3750, -2422.4709, 13.6356 },
   { 2593.4951, -2423.5051, 29.3171 },
   { 2616.0005, -2416.4211, 20.3246}
};

#define     MAX_KLASA   5

enum czKData
{
   czArmor,
   czZivoti,
   czCijena
};

new CZK[ MAX_KLASA ][ czKData ] =
{
   { 0, 5, 2500 },
   { 25, 10, 5000 },
   { 50, 20, 1000 },
   { 75, 25, 12500 },
   { 100, 30, 15000 }
};

#define    MAX_TOP     5

enum czLista
{
   Float:cznPos[4],
   cznUbistva,
   cznIme[MAX_PLAYER_NAME],
   cznSkin,
   // temp
   Text3D:cznLabel,
   cznAktor
};

new TopList[ MAX_TOP ][ czLista ] =
{
   { { 2515.0730,-2321.4878,28.2728,312.4460 }, 0, "Ime_Prezime", 0 },
   { { 2512.9080,-2319.0596,27.2128,310.2525 }, 0, "Ime_Prezime", 0 },
   { { 2510.0720,-2316.7803,26.2962,312.1324 }, 0, "Ime_Prezime", 0 },
   { { 2507.7759,-2313.8491,25.2528,313.0722 }, 0, "Ime_Prezime", 0 },
   { { 2504.7441,-2311.1895,24.6662,308.0587 }, 0, "Ime_Prezime", 0 }
};


[pawn]CMD:crvenazona( playerid )
{
   //SCM(playerid, -1, "Sistem ima problema , sacekajte 24 do 48 sati !");
    if( PI[ playerid ][ xWanted ] >= 1 ) return ErrorMessage( playerid, "Ne mozete uci na Crvenu Zonu dok imate Wanted Level.");

   if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2526.3083,-2323.3870,23.1715)) return ErrorMessage(playerid, "Niste kod crvene zone.");
   SPD(playerid, D_CZONA, DIALOG_STYLE_TABLIST_HEADERS, !"Crvena zona",
       !"ID klase\tPancir\tBroj zivota u zoni\tCena\n\
       1\t0\t5\t$2.500\n\
       2\t25\t10\t$5.000\n\
       3\t50\t20\t$10.000\n\
       4\t75\t25\t$12.500\n\
       5\tFULL\t30\t$15.000",
   !""col_ugblue"Izaberi", !""col_ugblue"Izlaz");
   return 1;
}

[/pawn]
[pawn]   "col_white"------------"col_blue" CZ Stats "col_white"------------\n\
   "col_blue"Crvena Zona Ubistva: "col_white"[%d]\n\
   "col_blue"Crvena Zona Smrti: "col_white"[%d]\n\[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): /
Poslednja Izmena: Avgust 07, 2021, 14:35:11 POSLE PODNE od M Ө M Σ N Z I

Citat: Zivkovic poslato Jul 26, 2021, 02:42:13 PRE PODNE
Problem(error/warning): Imam smrdljivi warring mnogo me zajebava i smeta mi da ga gledam na oci vise :( , nakon toga imam problem sa crvenom zonom kada idete /crvenazona sve lepo kupite zajebavate se sve top cik cak i onda kad zavrsite vam u  stats pise koliko imate kilova i na leadboard i ne sacuva se kada opet udjete u crvenu zonu na td dole se promeni sve na 0 ali u stats isto a ja ocu u stats da ostane koliko imam kilova i smrti da bi ostao na leadboard  8)
Deo skripte:  [pawn]#define ZIMSKI_MOD 0[/pawn]
C:\Users\PC\Desktop\Bs\gamemodes\bs1.0.pwn(1698) : warning 201: redefinition of constant/macro (symbol "ZIMSKI_MOD")

================================================
//crvena

[pawn]enum czData
{
   Float:czPos[4],
   czNagrada[5],
   Float:czpPos[3],
   //temp
   czLabel,
   czPickup,
   czZona,
   czDynamicArea
}

new CZ[ czData ];

new Text:CZ_TD[14];
new PlayerText:CZ_PTD[MAX_PLAYERS][3];

new Float:CZSpawns[5][3] =
{
   { 2593.6819, -2378.5083, 15.0407 },
   { 2595.7878, -2380.8240, 13.5134 },
   { 2577.3750, -2422.4709, 13.6356 },
   { 2593.4951, -2423.5051, 29.3171 },
   { 2616.0005, -2416.4211, 20.3246}
};

#define     MAX_KLASA   5

enum czKData
{
   czArmor,
   czZivoti,
   czCijena
};

new CZK[ MAX_KLASA ][ czKData ] =
{
   { 0, 5, 2500 },
   { 25, 10, 5000 },
   { 50, 20, 1000 },
   { 75, 25, 12500 },
   { 100, 30, 15000 }
};

#define    MAX_TOP     5

enum czLista
{
   Float:cznPos[4],
   cznUbistva,
   cznIme[MAX_PLAYER_NAME],
   cznSkin,
   // temp
   Text3D:cznLabel,
   cznAktor
};

new TopList[ MAX_TOP ][ czLista ] =
{
   { { 2515.0730,-2321.4878,28.2728,312.4460 }, 0, "Ime_Prezime", 0 },
   { { 2512.9080,-2319.0596,27.2128,310.2525 }, 0, "Ime_Prezime", 0 },
   { { 2510.0720,-2316.7803,26.2962,312.1324 }, 0, "Ime_Prezime", 0 },
   { { 2507.7759,-2313.8491,25.2528,313.0722 }, 0, "Ime_Prezime", 0 },
   { { 2504.7441,-2311.1895,24.6662,308.0587 }, 0, "Ime_Prezime", 0 }
};


[pawn]CMD:crvenazona( playerid )
{
   //SCM(playerid, -1, "Sistem ima problema , sacekajte 24 do 48 sati !");
    if( PI[ playerid ][ xWanted ] >= 1 ) return ErrorMessage( playerid, "Ne mozete uci na Crvenu Zonu dok imate Wanted Level.");

   if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2526.3083,-2323.3870,23.1715)) return ErrorMessage(playerid, "Niste kod crvene zone.");
   SPD(playerid, D_CZONA, DIALOG_STYLE_TABLIST_HEADERS, !"Crvena zona",
       !"ID klase\tPancir\tBroj zivota u zoni\tCena\n\
       1\t0\t5\t$2.500\n\
       2\t25\t10\t$5.000\n\
       3\t50\t20\t$10.000\n\
       4\t75\t25\t$12.500\n\
       5\tFULL\t30\t$15.000",
   !""col_ugblue"Izaberi", !""col_ugblue"Izlaz");
   return 1;
}

[/pawn]
[pawn]   "col_white"------------"col_blue" CZ Stats "col_white"------------\n\
   "col_blue"Crvena Zona Ubistva: "col_white"[%d]\n\
   "col_blue"Crvena Zona Smrti: "col_white"[%d]\n\[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): /

1. Vec si negde definisao ZIMSKI_MOD, koliko ja umem da citam, samo ti je reklo

2. Daj nam vise informacija, gde cuvas uopste to? Mozda si negde resetovao vrednost killova i smrti?

[pawn]forward ResetTopList();
public ResetTopList()
{
    mysql_pquery(Database, "UPDATE `"TABLE_PLAYERS"` SET `czubistva` = '0', `czsmrti` = '0' WHERE `czubistva` > 0 OR `czsmrti` > 0", "ResetActors", "");
   foreach(new i:Player)
   {
      if(PlayerLogged[ i ])
      {
         PI[ i ][ xCZUbistva ] = 0;
         PI[ i ][ xCZSmrti ] = 0;
      }
   }
   return 1;
}

forward ResetActors();
public ResetActors()
{
    new str[256];
    for(new i = 0; i < 5; i++)
    {
        if(IsValidDynamic3DTextLabel(TopList[ i ][ cznLabel ])) DestroyDynamic3DTextLabel(TopList[ i ][ cznLabel ]);
       if(IsValidDynamicActor(TopList[ i ][ cznAktor ])) DestroyDynamicActor(TopList[ i ][ cznAktor ]);
      strcpy(TopList[ i ][ cznIme ], "Niko");
      TopList[ i ][ cznSkin ] = 0;
      TopList[ i ][ cznUbistva ] = 0;
      format(str, sizeof(str), ""col_ugblue"%d. Mjesto\nIme: "col_white"%s\n"col_ugblue"Ubistva: "col_white"%d", i+1, TopList[ i ][ cznIme ], TopList[ i ][ cznUbistva ]);
      TopList[ i ][ cznLabel ] = CreateDynamic3DTextLabel( str, -1 , TopList[ i ][ cznPos ][ 0 ], TopList[ i ][ cznPos ][ 1 ], TopList[ i ][ cznPos ][ 2 ], 15.0 );
      TopList[ i ][ cznAktor ] = CreateDynamicActor( TopList[ i ][ cznSkin ], TopList[ i ][ cznPos ][ 0 ], TopList[ i ][ cznPos ][ 1 ], TopList[ i ][ cznPos ][ 2 ], TopList[ i ][ cznPos ][ 3 ]);
   }
   printf("Uspjesno su resetovani aktori, ubistva i smrti.");
   return 1;
}
forward MakeTopList();
public MakeTopList()
{
   for(new i; i < MAX_TOP; i++)
   {
       if(IsValidDynamic3DTextLabel(TopList[ i ][ cznLabel ])) DestroyDynamic3DTextLabel(TopList[ i ][ cznLabel ]);
       if(IsValidDynamicActor(TopList[ i ][ cznAktor ])) DestroyDynamicActor(TopList[ i ][ cznAktor ]);
   }
   new r = cache_num_rows();
   if(r)
   {
       for(new i; i < r; i++)
       {
           cache_get_value_name(i, "name", TopList[ i ][ cznIme ]);
           cache_get_value_name_int(i, "czubistva", TopList[ i ][ cznUbistva ]);
           cache_get_value_name_int(i, "skin", TopList[ i ][ cznSkin ]);
          
           new str[256];
           format(str, sizeof(str), ""col_ugblue"%d. Mjesto\nIme: "col_white"%s\n"col_ugblue"Ubistva: "col_white"%d", i+1, TopList[ i ][ cznIme ], TopList[ i ][ cznUbistva ]);
           TopList[ i ][ cznLabel ] = CreateDynamic3DTextLabel( str, -1 , TopList[ i ][ cznPos ][ 0 ], TopList[ i ][ cznPos ][ 1 ], TopList[ i ][ cznPos ][ 2 ], 15.0 );
         TopList[ i ][ cznAktor ] = CreateDynamicActor( TopList[ i ][ cznSkin ], TopList[ i ][ cznPos ][ 0 ], TopList[ i ][ cznPos ][ 1 ], TopList[ i ][ cznPos ][ 2 ], TopList[ i ][ cznPos ][ 3 ]);
      }
   }
   return 1;
}
forward CZTop(mjesto);
public CZTop(mjesto)
{
   new r = cache_num_rows();
   if(r)
   {
       new money, query[128];
       cache_get_value_int(0, "money", money);
      switch( mjesto )
      {
          case 0: money += 2000000;
          case 1: money += 1500000;
          case 2: money += 750000;
          case 3: money += 500000;
          case 4: money += 250000;
      }
      mysql_format(Database, query, sizeof(query), "UPDATE `"TABLE_PLAYERS"` SET `money` = '%d' WHERE `name` = '%e'", money, TopList[ mjesto - 1 ][ cznIme ]);
      mysql_tquery(Database, query);
      format(query, sizeof(query), "Igrac %s je %d. mjesto dodelite mu nagradu !", TopList[ mjesto - 1 ][ cznIme ], mjesto);
      VlasnikPoruka(CRVENA, query);
   }
   return 1;
}[/pawn]


[pawn]   //----------------[ Enum ]----------------
   for(new i = 0; i < 7; i++)
   {
      PI[ playerid ][ xCMD ][ i ] = 0;
   }
   PI[ playerid ][ xCZUbistva ] = 0;
   PI[ playerid ][ xCZSmrti ] = 0;[/pawn]

[pawn]   NaCZEventu[ playerid ] = false;[/pawn]

[pawn]  mysql_tquery(Database, "SELECT * FROM `"TABLE_PLAYERS"` ORDER BY `czubistva` DESC LIMIT 5", "MakeTopList");
        if( day == 1 && tmphour == 12)
      {[/pawn]


[pawn]On player data check
      cache_get_value_name_int(0, "czubistva", PI[playerid][xCZUbistva]);
      cache_get_value_name_int(0, "czsmrti", PI[playerid][xCZSmrti]);

    else if( NaCZEventu[ playerid ] == true )
   {
       if(CZBrojZivota[ playerid ] > 0)
       {
           new rand = random( sizeof( CZSpawns ) );
         BP_SetPlayerPos( playerid, CZSpawns[ rand ][ 0 ], CZSpawns[ rand ][ 1 ],CZSpawns[ rand ][ 2 ] );
         SetPlayerFacingAngle( playerid, 360.000 );
         SetCameraBehindPlayer( playerid );
         SetPlayerInterior( playerid, 0 );
         SetPlayerVirtualWorld( playerid, 1001 );

          CZGun1[ playerid ][0] = 0;
         CZGun1[ playerid ][1] = 0;
          CZGun2[ playerid ][0] = 0;
          CZGun2[ playerid ][1] = 0;
          CZGun3[ playerid ][0] = 0;
          CZGun3[ playerid ][1] = 0;
          CZCijena[ playerid ] = 0;
          CZKlasa[ playerid ] = 0;
          CZBrojZivota[ playerid ] = 0;
          NaCZEventu[ playerid ] = false;
          CZTDControl(playerid, false);
          SetPlayerVirtualWorld( playerid, 0 );
         CZZivih--;
         new zivih[ 4 ];
          format(zivih, sizeof(zivih), "%d", CZZivih );
          TextDrawSetString(CZ_TD[ 13 ], zivih);
          BP_SetPlayerPos( playerid, 2526.3083, -2323.3870, 23.1715 );
         SetPlayerFacingAngle( playerid, 360.000 );
         SetCameraBehindPlayer( playerid );
         SetPlayerInterior( playerid, 0 );
         SetPlayerVirtualWorld( playerid, 0 );
         ClearDeathMessage(playerid);
         return 1;


    if( NaCZEventu[ playerid ] /*&& killerid != INVALID_PLAYER_ID*/ && NaCZEventu[ killerid ])
    {
      PI[ playerid ][ xCZSmrti ] ++;
      PI[ killerid ][ xCZUbistva ] ++;
      UpdatePlayerSQLInt(playerid, "czsmrti", PI[ playerid ][ xCZSmrti ]);
      UpdatePlayerSQLInt(killerid, "czubistva", PI[ killerid ][ xCZUbistva ]);


[/pawn]