Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock StartCapture(zoneid, byplayer)
- {
- SendClientMessage(byplayer, LIGHTBLUE, "[ZONE] You've entered this zone! Stay for 30 seconds inside the red checkpoint to capture it! ");
- GangZoneFlashForAll(zoneid, GetTeamColor(GetPlayerTeam(byplayer)) );
- GZ[zoneid][Attacked] = true;
- GangZoneFlashForAll(zoneid, GetTeamZoneColor(GetPlayerTeam(byplayer)) );
- new Float:Pos[3];
- GetPlayerPos(byplayer, Pos[0], Pos[1], Pos[2]);
- SetPlayerCheckpoint(byplayer, Pos[0], Pos[1], Pos[2], 2.5);
- GZ[zoneid][Timer] = SetTimerEx("CompleteCapture", 30*1000, false, "idd", byplayer, zoneid, SUCCESS);
- pInfo[byplayer][Inzone] = zoneid;
- UpdateZoneInfo(zoneid);
- return 1;
- }
- public CompleteCapture(playerid, zoneid, cap_state)
- {
- switch(cap_state)
- {
- case SUCCESS:
- {
- GZ[zoneid][Owner] = GetPlayerTeam(playerid);
- KillTimer(GZ[zoneid][Timer]);
- GZ[zoneid][Attacked] = false;
- GangZoneStopFlashForAll(zoneid);
- GangZoneHideForAll(zoneid);
- GangZoneShowForAll(zoneid, GetTeamZoneColor(GetPlayerTeam(playerid)) );
- new str[150];
- format(str, 120, "[SUCCESSFUL CAPTURE] You've successfully captured %s! +5 score and 750$! ", GZ[zoneid][GName]);
- GivePlayerExperience(playerid, 5);
- GivePlayerMoney_(playerid, 750);
- SendClientMessage(playerid, GREEN, str);
- format(str, 120, "[LATEST CAPTURE] %s has captured %s", pname(playerid), GZ[zoneid][GName] );
- CreateNews(NEWS_CAPTURE, str);
- }
- case FAIL:
- {
- KillTimer(GZ[zoneid][Timer]);
- GZ[zoneid][Attacked] = false;
- GangZoneStopFlashForAll(zoneid);
- new str[150];
- format(str, 120, "[FAIL CAPTURE] You failed to capture %s! ", GZ[zoneid][GName]);
- SendClientMessage(playerid, RED, str);
- }
- }
- DisablePlayerCheckpoint(playerid);
- pInfo[playerid][Inzone] = -1;
- UpdateZoneInfo(zoneid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement