Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <streamer>
- #define pName(%1) PlayerName[%1]
- forward CheckIntactZones();
- enum E_IGZ { Float:gzPosX1, Float:gzPosY1, Float:gzPosX2, Float:gzPosY2, gzID, gzArea }
- new IntactGangZones[100][E_IGZ], IntactZoneTimer;
- new bool:IsIntactGZ[MAX_PLAYERS][100];
- new PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
- public OnFilterScriptInit() {
- new count = 0;
- for(new i1; i1 < 10; i1++) {
- for(new i2; i2 < 10; i2++) {
- IntactGangZones[count][gzPosX1] = -3000.0 + (i1 * 600.0);
- IntactGangZones[count][gzPosY1] = -3000.0 + (i2 * 600.0);
- IntactGangZones[count][gzPosX2] = (IntactGangZones[count][gzPosX1] + 600.0);
- IntactGangZones[count][gzPosY2] = (IntactGangZones[count][gzPosY1] + 600.0);
- IntactGangZones[count][gzID] = GangZoneCreate(IntactGangZones[count][gzPosX1], IntactGangZones[count][gzPosY1], IntactGangZones[count][gzPosX2], IntactGangZones[count][gzPosY2]);
- IntactGangZones[count][gzArea] = CreateDynamicRectangle(IntactGangZones[count][gzPosX1], IntactGangZones[count][gzPosY1], IntactGangZones[count][gzPosX2], IntactGangZones[count][gzPosY2], 0, 0);
- count++;
- }
- }
- IntactZoneTimer = SetTimer("CheckIntactZones", 1000, true);
- return 1;
- }
- public OnFilterScriptExit() {
- KillTimer(IntactZoneTimer);
- return 1;
- }
- public OnPlayerConnect(playerid) {
- GetPlayerName(playerid, PlayerName[playerid], MAX_PLAYER_NAME);
- for(new x; x < 100; x++) IsIntactGZ[playerid][x] = true; // Az összes terület felfedezetlen még.
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- PlayerName[playerid][0] = EOS;
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- SetPVarInt(playerid, "Spawned", 1);
- for(new x; x < sizeof(IntactGangZones); x++) if(IsIntactGZ[playerid][x]) GangZoneShowForPlayer(playerid, IntactGangZones[x][gzID], 0x8AE2FF65);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason) {
- SetPVarInt(playerid, "Spawned", 0);
- return 1;
- }
- public CheckIntactZones() {
- new string[144];
- for(new playerid; playerid < GetMaxPlayers(); playerid++) {
- if(GetPVarInt(playerid, "Spawned") && GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0) {
- if(IsPlayerInAnyDynamicArea(playerid)) {
- for(new x; x < 100; x++) {
- if(IsIntactGZ[playerid][x] == false) continue;
- if(IsPlayerInDynamicArea(playerid, IntactGangZones[x][gzArea])) {
- IsIntactGZ[playerid][x] = false;
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
- GangZoneHideForPlayer(playerid, IntactGangZones[x][gzID]);
- TogglePlayerDynamicArea(playerid, IntactGangZones[x][gzArea], false);
- new count;
- for(new y; y < 100; y++) if(IsIntactGZ[playerid][y] == false) count++;
- format(string, sizeof(string), "Egy ismeretlen rész felfedezve! {FFFF00}+1 {80FF80}Pont {FFFFFF}(%i/100)", count);
- SendClientMessage(playerid, 0x9C9C9CFF, string);
- if(count == 50) {
- format(string, sizeof(string), "Felfedezte %s(%i) a fél San Andreas térképet. {FFFFFF}+50{FFFF00}Pont", pName(playerid), playerid);
- SendClientMessageToAll(0xFF88F9FF, string);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 50);
- }
- if(count == 100) {
- format(string, sizeof(string), "Felfedezte %s(%i) az egész San Andreas térképet. {FFFFFF}+200{FFFF00}Pont", pName(playerid), playerid);
- SendClientMessageToAll(0xFF88F9FF, string);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + 200);
- }
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement