22.06.2012, 04:12
Guys.. I was begging you all. Please help me. Sa-mp is platform for helping. I am here. I shall be very thank full to you.
Look i made 2 capture systems. With different checkpoints, co-ordinates, pickup and mapicon. When i try to capture industry(capture) then satellite(capture2) become ours. Not industry. Industry don't show the colour but satellite did.
Problem No. 2 is. A single team can capture soo many times a single zone. That is that if zone belong to PAKISTAN than pakistan still can capture zone. I want if zone belong to Pakistan and Pakistan try to capture than Server will say " You can't capture zone that you owned". And we can' capture zone. Zone still remain same.
Here are My Codes:
> I am waiting for you help...
Look i made 2 capture systems. With different checkpoints, co-ordinates, pickup and mapicon. When i try to capture industry(capture) then satellite(capture2) become ours. Not industry. Industry don't show the colour but satellite did.
Problem No. 2 is. A single team can capture soo many times a single zone. That is that if zone belong to PAKISTAN than pakistan still can capture zone. I want if zone belong to Pakistan and Pakistan try to capture than Server will say " You can't capture zone that you owned". And we can' capture zone. Zone still remain same.
Here are My Codes:
pawn Code:
new capture;
new capture2;
new playericon;
new playericon2;
pawn Code:
capture = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);//Satellite
playericon = CreatePickup(1314, 23, -316.7369, 1594.6285, 75.6609, -1);
capture2 = GangZoneCreate(110.9276, 1336.2961, 288.1409, 1484.4271);//Industry
playericon2 = CreatePickup(1314, 23, 199.9323,1422.9177,10.5859, -1);
pawn Code:
public OnPlayerSpawn(playerid)
{
SetPlayerMapIcon(playerid,0,-316.7369,1594.6285,75.6609,53,19,2);
SetPlayerMapIcon(playerid,0,199.9323,1422.9177,10.5859,53,19,2);
return 1;
}
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
if(Checkpoint[playerid] == 1)
{
timer[playerid] = SetTimerEx("SetZone",30000,false,"i",playerid);
SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
}
if(Checkpoint[playerid] == 2)
{
timer[playerid] = SetTimerEx("SetZone",30000,false,"i",playerid);
SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
}
return 1;
}
forward SetZone(playerid);
public SetZone(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
GivePlayerMoney(playerid,3000);
SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
DisablePlayerCheckpoint(playerid);
Checkpoint[playerid] = 0;
SetGangZone(playerid);
return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN)
{
GangZoneShowForAll(capture,GREENA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_GERMANY)
{
GangZoneShowForAll(capture,ORANGEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For Germany",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(capture,BLUEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_RUSSIA)
{
GangZoneShowForAll(capture,REDA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_INDIA)
{
GangZoneShowForAll(capture,YELLOWA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
SendClientMessageToAll(0x008000AA,string);
}
return 1;
}
forward SetZone2(playerid);
public SetZone2(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
GivePlayerMoney(playerid,3000);
SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
DisablePlayerCheckpoint(playerid);
SetGangZone2(playerid);
Checkpoint[playerid] = 0;
return 1;
}
forward SetGangZone2(playerid);
public SetGangZone2(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN)
{
GangZoneShowForAll(capture2,GREENA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_GERMANY)
{
GangZoneShowForAll(capture2,ORANGEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For Germany",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(capture2,BLUEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_RUSSIA)
{
GangZoneShowForAll(capture2,REDA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
SendClientMessageToAll(0x008000AA,string);
}
if(gTeam[playerid] == TEAM_INDIA)
{
GangZoneShowForAll(capture2,YELLOWA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
SendClientMessageToAll(0x008000AA,string);
}
return 1;
}
pawn Code:
public OnPlayerLeaveCheckpoint(playerid)
{
if(Checkpoint[playerid] == 1)
{
KillTimer(timer[playerid]);
SendClientMessage(playerid,RED,"Capturing Zone Failed You have Left the Marker. ");
DisablePlayerCheckpoint(playerid);
Checkpoint[playerid] = 0;
}
if(Checkpoint[playerid] == 2)
{
KillTimer(timer[playerid]);
SendClientMessage(playerid,RED,"Capturing Zone Failed You have Left the Marker. ");
DisablePlayerCheckpoint(playerid);
Checkpoint[playerid] = 0;
}
return 1;
}
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == playericon)
{
if(Checkpoint[playerid] != 1)
{
Checkpoint[playerid] = 1;
SetPlayerCheckpoint(playerid, -316.7369,1594.6285,75.6609,2);
return 1;
}
}
if(pickupid == playericon2)
{
if(Checkpoint[playerid] != 2)
{
Checkpoint[playerid] = 2;
SetPlayerCheckpoint(playerid, 199.9323,1422.9177,10.5859,2);
return 1;
}
}
return 0;
}