SA-MP Forums Archive
SAVING GANG ZONES - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SAVING GANG ZONES (/showthread.php?tid=415748)



SAVING GANG ZONES - California_ - 14.02.2013

Hey Im using the VERY-SUPER Edited version of https://sampforum.blast.hk/showthread.php?tid=45318


Im trying to find a way to save The Gang zones. For example heres the gang zone script [You cant steal it. If you do. you will have mighty errors. I've hidden some errors in it for people cant steal it



My question is. Can anyone help me by making this save the gang zones. ? My players are getting pissed about this.


pawn Код:
SetPlayerWantedLevel( killerid, GetPlayerWantedLevel( killerid )+1 );
          TeamInfo[ gTeam[killerid] ][ RivalsKilled ]++;
          TeamInfo[ gTeam[playerid] ][ HomiesDied ]++;
          TeamInfo[ gTeam[killerid] ][ TeamScore ]++;
          TeamInfo[ gTeam[playerid] ][ TeamScore ]--;
//----------------------------- player was killed in a turf? -------------------
          GetPlayerPos(playerid, x, y, z);
          GetPlayerPos(killerid, x, y, z);
          for (new i = 0; i < MAX_TURFS; i++)
          {
               if (IsPlayerInTurf(playerid, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY]) &&
                   IsPlayerInTurf(killerid, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY])  )
               {
                   if (turfs[ i ][ TurfWarStarted ] != 1 && !IsPlayerInAnyVehicle(killerid))
                   {
                       TurfInfo[ i ][ gTeam[killerid] ][ TurfKills ]++;
                       if (TurfInfo[ i ][ gTeam[killerid] ][ TurfKills ] == ATTACK_KILLS)
                       {
                           if (turfs[ i ][ TurfOwner ] == gTeam[killerid]) {
                               for (new a=0; a<MAX_TEAMS; a++) { TurfInfo[ i ][ a ][ TurfKills ] =0; }
                               return 1;
                           }

                           turfs[ i ][ TurfAttacker ] = gTeam[killerid];
                           for (new b=0; b<SLOTS; b++)
                           {
                                if (gTeam[ b ] == turfs[ i ][ TurfAttacker ]) {
                                      new msg1[ 256 ];
                                      format(msg1,sizeof(msg1), "~w~We have provoked a turfwar ~w~in ~y~%s ~w~against the ~r~%s",
                                      turfs[ i ][ turfName ], TeamInfo[ turfs[ i ][ TurfOwner ] ][ TeamName ]);
                                      new Text:txt1 = TextDrawCreate( 200.0, 385.0, msg1 );
                                      TextDrawFont( txt1, 0 );
                                      TextDrawSetShadow( txt1, 0 );
                                      TextDrawSetOutline( txt1, 1 );
                                      TextDrawColor( txt1, 0xDFDFDFFF );
                                      TimeTextForPlayer( b, txt1, 6000 );
                                      GangZoneFlashForPlayer( b, turfs[ i ][turfID], COLOR_FLASH );
                                }
                                else if (gTeam[b] == turfs[ i ][ TurfOwner ]) {
                                      new msg2[ 256 ];
                                      format(msg2,sizeof(msg2), "~r~The ~y~%s ~r~have attacked our turf in ~y~%s!",
                                      TeamInfo[ turfs[ i ][ TurfAttacker ] ][ TeamName ], turfs[ i ][ turfName ]);
                                      new Text:txt2 = TextDrawCreate( 200.0, 370.0, msg2 );
                                      TextDrawFont( txt2, 0 );
                                      TextDrawSetShadow( txt2, 0 );
                                      TextDrawSetOutline( txt2, 1 );
                                      TextDrawColor( txt2, COLOR_RED );
                                      TimeTextForPlayer( b, txt2, 6000 );
                                      GangZoneFlashForPlayer( b, turfs[ i ][turfID], COLOR_FLASH );
                                }
                                else { GangZoneFlashForPlayer( b, turfs[ i ][turfID], COLOR_FLASH2 ); }
                           }
                           SetTimerEx("EndWar", ATTACK_TIME, false ,"iii", i, turfs[ i ][ TurfAttacker ], turfs[ i ][ TurfOwner ] );
                           turfs[ i ][ TurfWarStarted ] =1;
                           for(new c=0; c<MAX_TEAMS; c++) { TurfInfo[ i ][ c ][ TurfKills ] =0; TurfInfo[ i ][ c ][ TurfAttackKills ] =0; }
                           return 1;
                       }
                   }
                   else if (turfs[ i ][ TurfWarStarted ] == 1 && !IsPlayerInAnyVehicle(killerid) &&
                           (turfs[ i ][ TurfAttacker ] == gTeam[killerid]) || turfs[ i ][ TurfOwner ] == gTeam[killerid])
                   {
                       TurfInfo[ i ][ gTeam[killerid] ][ TurfAttackKills ]++;
                       return 1;
                   }
               }
          }



Re: SAVING GANG ZONES - California_ - 17.02.2013

IT'S BEEN 1 DAY?

HELLO? HEELLO?? ANY ANSWERS


Re: SAVING GANG ZONES - dEcooR - 24.06.2013

You cant make this i cant search it too :S


Re: SAVING GANG ZONES - Pottus - 24.06.2013

Try using sqlite to keep track of your gangzones including loading/saving.


Re: SAVING GANG ZONES - dEcooR - 24.06.2013

What do u mean sqlite