Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public SetPlayerUnjail()
- {
- if(painttime > 0)
- {
- painttime--;
- }
- foreach(Player, z)
- {
- if(playerVariables[z][pDD] >= 1)
- {
- playerVariables[z][pDD] --;
- }
- if(playerVariables[z][pDs] >= 1)
- {
- playerVariables[z][pDs] --;
- }
- if(playerVariables[z][pDr] >= 1)
- {
- playerVariables[z][pDr] --;
- }
- }
- for(new iGroup; iGroup < MAX_GROUPS; iGroup++)
- {
- if(groupVariables[iGroup][gDeelay] >= 1)
- {
- groupVariables[iGroup][gDeelay]--;
- }
- }
- for(new i = 0; i <= sizeof(TurfInfo); i++)
- {
- new string[256];
- new count = 0;
- new att = WarInfo[i][wAttacker];
- new deff = WarInfo[i][wFaction];
- if(WarInfo[i][wTime] > 0)
- {
- WarInfo[i][wTime] -= 1;
- foreach(Player, x)
- {
- if(playerVariables[x][pGroup] == WarInfo[i][wAttacker])
- {
- if(IsPlayerInTurf(x , i))
- {
- count++;
- }
- }
- if(groupVariables[playerVariables[x][pGroup]][gInWar] == 0)
- {
- foreach(Player, a)
- {
- SetPlayerMarkerForPlayer( x, a, ( GetPlayerColor( a ) & 0xFFFFFF00 ) );
- }
- }
- if(playerVariables[x][pGroup] == WarInfo[i][wAttacker] || playerVariables[x][pGroup] == WarInfo[i][wFaction])
- {
- new time = WarInfo[i][wTime];
- TextDrawShowForPlayer(x, tTimer[x]);
- format(string, sizeof(string), "War time: ~y~%s ~w~", CalculeazaTimp(time));
- TextDrawSetString(tTimer[x], string);
- GangZoneFlashForPlayer(x, Turfs[i], COLOR_RED);
- if(IsPlayerInTurf(x, i))
- {
- if(IsPlayerInAnyVehicle(x))
- {
- if(JustRemoved[x] == 0)
- {
- RemovePlayerFromVehicle(x);
- SendClientMessage(x, COLOR_RED, "Nu ai voie intr-o masina pe turf!");
- JustRemoved[x] = 1;
- }
- }
- }
- foreach(Player, a)
- {
- if((playerVariables[x][pGroup] == WarInfo[i][wAttacker] || playerVariables[x][pGroup] == WarInfo[i][wFaction]) && groupVariables[playerVariables[x][pGroup]][gInWar] == 1 && (playerVariables[a][pGroup] == WarInfo[i][wAttacker] || playerVariables[a][pGroup] == WarInfo[i][wFaction]))
- {
- SetPlayerMarkerForPlayer(x, a, GetPlayerColor(a));
- }
- }
- if(GetPlayerState(x) == PLAYER_STATE_ONFOOT)
- {
- JustRemoved[x] = 0;
- }
- }
- else if(playerVariables[x][pGroup] == 0)
- {
- TextDrawHideForPlayer(x, tTimer[x]);
- GangZoneStopFlashForPlayer(x, Turfs[i]);
- }
- }
- if(count == 0)
- {
- groupVariables[WarInfo[i][wFaction]][gInWar] = 0;
- groupVariables[WarInfo[i][wAttacker]][gInWar] = 0;
- groupVariables[att][gDeelay] = 600;
- new id;
- id = CalculateBestScore(i);
- new id2 = CalculateWorstScore(i);
- format(szMessage, sizeof(szMessage), "--------------------[war overview]-----------------");
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- format(szMessage, sizeof(szMessage), "Score: %s %d - %d %s",groupVariables[WarInfo[i][wAttacker]][gGroupName] , groupVariables[WarInfo[i][wAttacker]][gScore], groupVariables[deff][gScore], groupVariables[deff][gGroupName]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- format(szMessage, sizeof(szMessage), "Best score: %s (%i). Worst score: %s (%i)", playerVariables[id][pNormalName], playerVariables[id][pWarScore] - playerVariables[id][pWarDeaths], playerVariables[id2][pNormalName], playerVariables[id2][pWarScore] - playerVariables[id2][pWarDeaths]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- foreach(Player, z)
- {
- TextDrawHideForPlayer(z, tTimer[z]);
- if(playerVariables[z][pGroup] == att || playerVariables[z][pGroup] == deff)
- {
- foreach(Player, a)
- {
- SetPlayerMarkerForPlayer( z, a, ( GetPlayerColor( a ) & 0xFFFFFF00 ) );
- }
- TextDrawHideForPlayer(z, tTimer[z]);
- format(szMessage, sizeof(szMessage), "Your personal score: %i", playerVariables[z][pWarScore] - playerVariables[z][pWarDeaths]);
- SendClientMessage(z, COLOR_ATTACK, szMessage);
- playerVariables[z][pWarScore] = 0;
- playerVariables[z][pWarDeaths] = 0;
- GangZoneShowForPlayerEx(z, Turfs[i], GetTeamZoneColor(TurfInfo[i][zOwned]));
- TextDrawHideForPlayer(z, War0[z]);
- TextDrawHideForPlayer(z, War1[z]);
- TextDrawHideForPlayer(z, War2[z]);
- TextDrawHideForPlayer(z, War3[z]);
- JustRemoved[z] = 0;
- }
- }
- format(szMessage, sizeof(szMessage), "-------------------------------------");
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- format(szMessage, sizeof(szMessage), "[WAR] %s failed to win turf %i owned by %s because they left the turf.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- GangZoneStopFlashForAll(Turfs[i]);
- WarInfo[i][wTime] = 0;
- WarInfo[i][wAttacker] = 0;
- WarInfo[i][wFaction] = 0;
- }
- if(WarInfo[i][wTime] == 2)
- {
- if(groupVariables[WarInfo[i][wAttacker]][gScore] > groupVariables[WarInfo[i][wFaction]][gScore])
- {
- TurfInfo[i][zOwned] = WarInfo[i][wAttacker];
- format(result, sizeof(result), "UPDATE turfs SET Owned = '%d' WHERE ID = %d", TurfInfo[i][zOwned], i);
- mysql_tquery(handle, result);
- format(szMessage, sizeof(szMessage), "NR AdmBot: Gruparea mafiota %s a cucerit teritoriul %i care era detinut de mafia %s.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
- SendClientMessageToAll(COLOR_NEWSRP, szMessage);
- groupVariables[att][gDeelay] = 300;
- }
- else if(groupVariables[WarInfo[i][wAttacker]][gScore] < groupVariables[WarInfo[i][wFaction]][gScore])
- {
- TurfInfo[i][zOwned] = WarInfo[i][wFaction];
- format(result, sizeof(result), "UPDATE turfs SET Owned = '%d' WHERE ID = %d", TurfInfo[i][zOwned], i);
- mysql_tquery(handle, result);
- groupVariables[att][gDeelay] = 600;
- format(szMessage, sizeof(szMessage), "[WAR] %s failed to win turf %i owned by %s.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- }
- else if(groupVariables[WarInfo[i][wAttacker]][gScore] == groupVariables[WarInfo[i][wFaction]][gScore])
- {
- TurfInfo[i][zOwned] = WarInfo[i][wFaction];
- format(result, sizeof(result), "UPDATE turfs SET Owned = '%d' WHERE ID = %d", TurfInfo[i][zOwned], i);
- mysql_tquery(handle, result);
- groupVariables[att][gDeelay] = 600;
- format(szMessage, sizeof(szMessage), "[WAR] %s failed to win turf %i owned by %s.", groupVariables[att][gGroupName], i, groupVariables[deff][gGroupName]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- }
- new id;
- id = CalculateBestScore(i);
- new id2 = CalculateWorstScore(i);
- groupVariables[WarInfo[i][wFaction]][gInWar] = 0;
- groupVariables[WarInfo[i][wAttacker]][gInWar] = 0;
- format(szMessage, sizeof(szMessage), "--------------------[war overview]-----------------");
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- format(szMessage, sizeof(szMessage), "Score: %s %d - %d %s",groupVariables[WarInfo[i][wAttacker]][gGroupName] , groupVariables[WarInfo[i][wAttacker]][gScore], groupVariables[deff][gScore], groupVariables[deff][gGroupName]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- format(szMessage, sizeof(szMessage), "Best score: %s (%i). Worst score: %s (%i)", playerVariables[id][pNormalName], playerVariables[id][pWarScore] - playerVariables[id][pWarDeaths], playerVariables[id2][pNormalName], playerVariables[id2][pWarScore] - playerVariables[id2][pWarDeaths]);
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- foreach(Player, z)
- {
- TextDrawHideForPlayer(z, tTimer[z]);
- if(playerVariables[z][pGroup] == att || playerVariables[z][pGroup] == deff)
- {
- foreach(Player, a)
- {
- SetPlayerMarkerForPlayer( z, a, ( GetPlayerColor( a ) & 0xFFFFFF00 ) );
- }
- TextDrawHideForPlayer(z, tTimer[z]);
- format(szMessage, sizeof(szMessage), "Your personal score: %i", playerVariables[z][pWarScore] - playerVariables[z][pWarDeaths]);
- SendClientMessage(z, COLOR_ATTACK, szMessage);
- playerVariables[z][pWarScore] = 0;
- playerVariables[z][pWarDeaths] = 0;
- GangZoneShowForPlayerEx(z, Turfs[i], GetTeamZoneColor(TurfInfo[i][zOwned]));
- JustRemoved[z] = 0;
- }
- }
- format(szMessage, sizeof(szMessage), "-------------------------------------");
- SendToGroup(att, COLOR_ATTACK, szMessage);
- SendToGroup(deff, COLOR_ATTACK, szMessage);
- GangZoneStopFlashForAll(Turfs[i]);
- WarInfo[i][wTime] = 0;
- WarInfo[i][wAttacker] = 0;
- WarInfo[i][wFaction] = 0;
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- if(PaintballRound == 1 && PlayerPaintballing[i] != 0)
- {
- new string[256];
- format(string,sizeof(string),"Paintball time: %s", CalculeazaTimp2(painttime));
- TextDrawSetString(Paintball[3][i], string);
- TextDrawShowForPlayer(i, Paintball[3][i]);
- }
- if(PlayerStoned[i] >= 2)
- {
- new Float:angle;
- GetPlayerFacingAngle(i, angle);
- if(IsPlayerInAnyVehicle(i))
- {
- if(GetPlayerState(i) == 2)
- {
- SetVehicleZAngle(GetPlayerVehicleID(i), angle + 15);
- SetPlayerDrunkLevel (i, 5000);
- }
- }
- else
- {
- SetPlayerDrunkLevel (i, 5000);
- }
- }
- if(MedicCallTime[i] > 0)
- {
- if(MedicAccepted[i] < 999)
- {
- if(IsPlayerConnected(MedicAccepted[i]))
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(MedicAccepted[i], X, Y, Z);
- SetPlayerCheckpoint(i, X, Y, Z, 5);
- }
- }
- }
- if(TaxiCallTime[i] > 0)
- {
- if(TaxiAccepted[i] < 999)
- {
- if(IsPlayerConnected(TaxiAccepted[i]))
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(TaxiAccepted[i], X, Y, Z);
- SetPlayerCheckpoint(i, X, Y, Z, 5);
- }
- }
- }
- if(FindTime[i] > 0)
- {
- if(PlayerFind[i] != 999)
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(PlayerFind[i], X,Y,Z);
- SetPlayerCheckpoint(i, X,Y,Z, 6);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment