23.03.2017, 10:39
No, the Capturing in 30 doesnt even show. I just got that message and nothing more. No progress bar, no capturing, no flash.
This is OnZoneUpdate:
This is the full OnPlayerEnterDynamicCp (which i get a warning when compiling because OnPlayerEnterDynamicCp should return a value..)
This is OnZoneUpdate:
Код:
public OnZoneUpdate(zoneid) { switch(gCaptureZone[zoneid][zone_Players]) { case 1: { gCaptureZone[zoneid][zone_Tick][0] += 1; gCaptureZone[zoneid][zone_Tick][1] -= 1; } case 2: { gCaptureZone[zoneid][zone_Tick][0] += 2; gCaptureZone[zoneid][zone_Tick][1] += 2; } default: { gCaptureZone[zoneid][zone_Tick][0] += 3; gCaptureZone[zoneid][zone_Tick][1] += 2; } } for (new i, j = GetPlayerPoolSize(); i <= j; i++) { if (IsPlayerInDynamicCP(i, gCaptureZone[zoneid][zone_CPId]) && ! IsPlayerInAnyVehicle(i) && GetPlayerTeam(i) == GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker])) // if the player is in CP, outside any vehicle and of same team that of attacker { SetPlayerProgressBarValue(i, pbarCapture[i], gCaptureZone[zoneid][zone_Tick][0]); } } if (gCaptureZone[zoneid][zone_Tick][0] > CAPTURE_TIME) { SendClientMessage(gCaptureZone[zoneid][zone_Attacker], 0x00FF00FF, "You have successfully captured the zone, +3 score and +$3000."); SetPlayerScore(gCaptureZone[zoneid][zone_Attacker], GetPlayerScore(gCaptureZone[zoneid][zone_Attacker]) + 3); GivePlayerMoney(gCaptureZone[zoneid][zone_Attacker], 3000); for (new p, l = GetPlayerPoolSize(); p <= l; p++) { if (IsPlayerInDynamicCP(p, gCaptureZone[zoneid][zone_CPId])) { PlayerTextDrawHide(p, ptxtCapture[p]); HidePlayerProgressBar(p, pbarCapture[p]); if (p != gCaptureZone[zoneid][zone_Attacker] && GetPlayerTeam(p) == GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker]) && ! IsPlayerInAnyVehicle(p)) { SendClientMessage(p, 0x00FF00FF, "You have assisted your teammate to capture the zone, +1 score and +$1500."); SetPlayerScore(p, GetPlayerScore(p) + 1); GivePlayerMoney(p, 1500); } } } GangZoneStopFlashForAll(gCaptureZone[zoneid][zone_Id]); GangZoneShowForAll(gCaptureZone[zoneid][zone_Id], SET_ALPHA(gTeamData[GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker])][team_Color], 100)); KillTimer(gCaptureZone[zoneid][zone_Timer]); new text[150]; strcat(text, "ZONE: Team "); strcat(text, gTeamData[GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker])][team_Name]); strcat(text, " has successfully captured the zone "); strcat(text, gCaptureZone[zoneid][zone_Name]); strcat(text, " against team "); strcat(text, gTeamData[gCaptureZone[zoneid][zone_Owner]][team_Name]); strcat(text, "."); SendClientMessageToAll(0xFFFFFFFF, text); gCaptureZone[zoneid][zone_Owner] = GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker]); gCaptureZone[zoneid][zone_Attacker] = INVALID_PLAYER_ID; } }
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { for (new i, j = sizeof(gCaptureZone); i < j; i++) { if (gCaptureZone[i][zone_CPId] == checkpointid) { new buf[150]; if (gCaptureZone[i][zone_Attacker] != INVALID_PLAYER_ID) { if (GetPlayerTeam(playerid) == GetPlayerTeam(gCaptureZone[i][zone_Attacker])) { if (IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot capture the zone in a vehicle."); } format(buf, sizeof(buf), "Capturing in %i...", gCaptureZone[i][zone_Tick][1]); PlayerTextDrawSetString(playerid, ptxtCapture[playerid], buf); PlayerTextDrawShow(playerid, ptxtCapture[playerid]); SetPlayerProgressBarValue(playerid, pbarCapture[playerid], gCaptureZone[i][zone_Tick][0]); ShowPlayerProgressBar(playerid, pbarCapture[playerid]); gCaptureZone[i][zone_Players]++; SendClientMessage(playerid, 0x00FF00FF, "Stay in the checkpoint to assist your teammate in capturing the zone."); } } else { if (GetPlayerTeam(playerid) != gCaptureZone[i][zone_Owner]) { if (IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot capture the zone in a vehicle."); } buf[0] = EOS; strcat(buf, "The zone is controlled by team "); strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]); strcat(buf, "."); SendClientMessage(playerid, 0x00FF00FF, buf); SendClientMessage(playerid, 0x00FF00FF, "Stay in the checkpoint for "#CAPTURE_TIME" seconds to capture the zone."); GangZoneFlashForAll(gCaptureZone[i][zone_Id], SET_ALPHA(gTeamData[GetPlayerTeam(playerid)][team_Color], 100)); gCaptureZone[i][zone_Attacker] = playerid; gCaptureZone[i][zone_Players] = 1; gCaptureZone[i][zone_Tick][0] = 0; gCaptureZone[i][zone_Tick][1]= CAPTURE_TIME; KillTimer(gCaptureZone[i][zone_Timer]); gCaptureZone[i][zone_Timer] = SetTimerEx("OnZoneUpdate", 1000, true, "i", i); buf[0] = EOS; strcat(buf, "ZONE: Team "); strcat(buf, gTeamData[GetPlayerTeam(playerid)][team_Name]); strcat(buf, " is trying to capture zone "); strcat(buf, gCaptureZone[i][zone_Name]); strcat(buf, " against team "); strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]); strcat(buf, "."); SendClientMessageToAll(0xFFFFFFFF, buf); PlayerTextDrawSetString(playerid, ptxtCapture[playerid], "Capturing in 30..."); PlayerTextDrawShow(playerid, ptxtCapture[playerid]); SetPlayerProgressBarValue(playerid, pbarCapture[playerid], gCaptureZone[i][zone_Tick][0]); ShowPlayerProgressBar(playerid, pbarCapture[playerid]); } } break; } } }