Advertisement
PedroHUN52

Felfedezhető területek - Pedró (2014)

Dec 22nd, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.55 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <streamer>
  5.  
  6. #define pName(%1) PlayerName[%1]
  7.  
  8. forward CheckIntactZones();
  9.  
  10. enum E_IGZ { Float:gzPosX1, Float:gzPosY1, Float:gzPosX2, Float:gzPosY2, gzID, gzArea }
  11. new IntactGangZones[100][E_IGZ], IntactZoneTimer;
  12. new bool:IsIntactGZ[MAX_PLAYERS][100];
  13. new PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
  14.  
  15. public OnFilterScriptInit() {
  16.     new count = 0;
  17.     for(new i1; i1 < 10; i1++) {
  18.         for(new i2; i2 < 10; i2++) {
  19.             IntactGangZones[count][gzPosX1] = -3000.0 + (i1 * 600.0);
  20.             IntactGangZones[count][gzPosY1] = -3000.0 + (i2 * 600.0);
  21.             IntactGangZones[count][gzPosX2] = (IntactGangZones[count][gzPosX1] + 600.0);
  22.             IntactGangZones[count][gzPosY2] = (IntactGangZones[count][gzPosY1] + 600.0);
  23.             IntactGangZones[count][gzID] = GangZoneCreate(IntactGangZones[count][gzPosX1], IntactGangZones[count][gzPosY1], IntactGangZones[count][gzPosX2], IntactGangZones[count][gzPosY2]);
  24.             IntactGangZones[count][gzArea] = CreateDynamicRectangle(IntactGangZones[count][gzPosX1], IntactGangZones[count][gzPosY1], IntactGangZones[count][gzPosX2], IntactGangZones[count][gzPosY2], 0, 0);
  25.  
  26.             count++;
  27.         }
  28.     }
  29.    
  30.     IntactZoneTimer = SetTimer("CheckIntactZones", 1000, true);
  31.     return 1;
  32. }
  33.  
  34. public OnFilterScriptExit() {
  35.     KillTimer(IntactZoneTimer);
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerConnect(playerid) {
  40.     GetPlayerName(playerid, PlayerName[playerid], MAX_PLAYER_NAME);
  41.  
  42.     for(new x; x < 100; x++) IsIntactGZ[playerid][x] = true; // Az összes terület felfedezetlen még.
  43.     return 1;
  44. }
  45.  
  46. public OnPlayerDisconnect(playerid, reason) {
  47.     PlayerName[playerid][0] = EOS;
  48.     return 1;
  49. }
  50.  
  51. public OnPlayerSpawn(playerid) {
  52.     SetPVarInt(playerid, "Spawned", 1);
  53.     for(new x; x < sizeof(IntactGangZones); x++) if(IsIntactGZ[playerid][x]) GangZoneShowForPlayer(playerid, IntactGangZones[x][gzID], 0x8AE2FF65);
  54.     return 1;
  55. }
  56.  
  57. public OnPlayerDeath(playerid, killerid, reason) {
  58.     SetPVarInt(playerid, "Spawned", 0);
  59.     return 1;
  60. }
  61.  
  62. public CheckIntactZones() {
  63.     new string[144];
  64.     for(new playerid; playerid < GetMaxPlayers(); playerid++) {
  65.         if(GetPVarInt(playerid, "Spawned") && GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0) {
  66.             if(IsPlayerInAnyDynamicArea(playerid)) {
  67.                 for(new x; x < 100; x++) {
  68.                     if(IsIntactGZ[playerid][x] == false) continue;
  69.                     if(IsPlayerInDynamicArea(playerid, IntactGangZones[x][gzArea])) {
  70.                         IsIntactGZ[playerid][x] = false;
  71.                         SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
  72.                         GangZoneHideForPlayer(playerid, IntactGangZones[x][gzID]);
  73.                         TogglePlayerDynamicArea(playerid, IntactGangZones[x][gzArea], false);
  74.  
  75.                         new count;
  76.                         for(new y; y < 100; y++) if(IsIntactGZ[playerid][y] == false) count++;
  77.  
  78.                         format(string, sizeof(string), "Egy ismeretlen rész felfedezve! {FFFF00}+1 {80FF80}Pont {FFFFFF}(%i/100)", count);
  79.                         SendClientMessage(playerid, 0x9C9C9CFF, string);
  80.  
  81.                         if(count == 50) {
  82.                             format(string, sizeof(string), "Felfedezte %s(%i) a fél San Andreas térképet. {FFFFFF}+50{FFFF00}Pont", pName(playerid), playerid);
  83.                             SendClientMessageToAll(0xFF88F9FF, string);
  84.                             SetPlayerScore(playerid, GetPlayerScore(playerid) + 50);
  85.                         }
  86.                         if(count == 100) {
  87.                             format(string, sizeof(string), "Felfedezte %s(%i) az egész San Andreas térképet. {FFFFFF}+200{FFFF00}Pont", pName(playerid), playerid);
  88.                             SendClientMessageToAll(0xFF88F9FF, string);
  89.                             SetPlayerScore(playerid, GetPlayerScore(playerid) + 200);
  90.                         }
  91.                     }
  92.                 }
  93.             }
  94.         }
  95.     }
  96.     return 1;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement