18.01.2013, 07:11
Quote:
new Zone[30]; new timer[MAX_PLAYERS][30]; new iCP[MAX_PLAYERS];//To check player went in which CP. new tCP[30]; |
Quote:
Checkpoint[GZONE] = CreateDynamicCP(2528.2610,-1668.1365,15.1692,2,-1,-1,-1); Zone[GZONE] = GangZoneCreateEx(2370.609, -1728.326, 2522.421, -1634.903, 1, 1.0); |
Quote:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { if(checkpointid == Checkpoint[GZONE]) { // if(tCP[GZONE] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team."); if(gTeam[playerid] == tCP[GZONE]) return SendClientMessage(playerid,0xFFFFFF,"This turf is already captured by your team."); timer[playerid][GZONE] = SetTimerEx("SetZone",30000,false,"i",playerid); SendClientMessage(playerid,0xFFFFFF,"Wait for 45 sec to take over the Turf "); iCP[playerid] = GZONE; } /* if(checkpointid == Checkpoint[GAS]) { if(tCP[GAS] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team."); timer[playerid][GAS] = SetTimerEx("SetZone",2000,false,"i",playerid); SendClientMessage(playerid,0xFFFFFF,"You enter GAS CP"); iCP[playerid] = GAS; } */ return 1; } public OnPlayerLeaveDynamicCP(playerid, checkpointid) { if(checkpointid == Checkpoint[GZONE]) { KillTimer(timer[playerid][GZONE]); iCP[playerid] = -1;//None } /* if(checkpointid == Checkpoint[GAS]) { KillTimer(timer[playerid][GAS]); SendClientMessage(playerid,0xFFFFFF,"You left GAS CP"); iCP[playerid] = -1; } */ return 1; } forward SetZone(playerid); public SetZone(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 3); GivePlayerMoney(playerid,3000); SendClientMessage(playerid,COLOR_GREEN,"Congratula tion! You have Gained 3 Scores & 3000$ Money "); SetGangZone(playerid); return 1; } |
Quote:
forward SetGangZone(playerid);public SetGangZone(playerid) { if(gTeam[playerid] == TEAM_GROVE) { GangZoneShowForAll(Zone[GAS],COLOR_GREEN); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured GasStation For GROVE",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_AZTECA) { GangZoneShowForAll(Zone[GAS],COLOR_LIGHTBLUE); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured GasStation For AEZATECAS",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_POLICE) { GangZoneShowForAll(Zone[GAS],COLOR_BLUE); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured GasStation For POLICE",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_BALLAS) { GangZoneShowForAll(Zone[GAS],COLOR_PURPLE); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured GasStation For BALLA",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_TRIADS) { GangZoneShowForAll(Zone[GAS],RED); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured GasStation For TRIAD",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_VAGOS) { GangZoneShowForAll(Zone[GZONE],COLOR_YELLOW); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured Satellite For VAGOS",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_DANANG) { GangZoneShowForAll(Zone[GZONE],COLOR_OLIVE); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured Satellite For DANANG",pName); SendClientMessageToAll(0x008000AA,string); } if(gTeam[playerid] == TEAM_MAFIA) { GangZoneShowForAll(Zone[GZONE],COLOR_MAROON); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Server News: %s has captured Satellite For MAFIA",pName); SendClientMessageToAll(0x008000AA,string); } return 1; } |