23.06.2012, 06:51
Hey Guys. First of all i thanks to ROXXOR. Who helped me very very and very well. He is hardworking guy and best scripter. Thank you roxxor. Then i thanks to MadMan.
I have now 1 problem. Every thing is Fine. Problem is that " Set player map icon" is not showing. Only one is showing. What is the problem??
I have now 1 problem. Every thing is Fine. Problem is that " Set player map icon" is not showing. Only one is showing. What is the problem??
pawn Код:
#include <a_samp>
#include <streamer>
#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4
#define COLOR_WHITE 0xFFFFFFAA
#define YELLOWA 0xFFFF00AA
#define GREENA 0x008000AA
#define BLUEA 0x0080FFAA
#define REDA 0xFF0000AA
#define ORANGEA 0xFF8000AA
#define LGREEN 0x33AA33AA
#define YELLOW 0xFFFF00FF
#define COLOR_PINK 0xFF66FFAA
#define RED 0xFF0000FF
#define GREEN 0x008000FF
//==============================================================================
#pragma tabsize 0
#define GZONE 0
#define GAS 1
#define INDU 2
#define HOSP 3
new gTeam[MAX_PLAYERS];
new timer[MAX_PLAYERS][30];
new iCP[MAX_PLAYERS];//To check player went in which CP.
new tCP[30];
new Checkpoint[30];
new Zone[30];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Zone By Syed_Raza");
print("--------------------------------------\n");
Checkpoint[GZONE] = CreateDynamicCP(-316.7369+10,1594.6285,75.6609,2,-1,-1,-1);
Checkpoint[GAS] = CreateDynamicCP( 611.4569,1694.5847,6.9922,2,-1,-1,-1);
Checkpoint[INDU] = CreateDynamicCP( 199.9323,1422.9177,10.5859,2,-1,-1,-1);
Checkpoint[HOSP] = CreateDynamicCP( 1089.3484,1076.1520,10.8359,2,-1,-1,-1);
Zone[GZONE] = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
Zone[GAS] = GangZoneCreate(521.7093, 1616.373, 677.9031, 1798.172);
Zone[INDU] = GangZoneCreate(110.9276, 1336.2961, 288.1409, 1484.4271);
Zone[HOSP] = GangZoneCreate(958.4065, 957.5846, 1167.0884, 1182.8335);
tCP[GZONE] = -1;
tCP[GAS]= -1;
tCP[INDU]= -1;
tCP[HOSP]= -1;
return 1;
}
public OnPlayerSpawn(playerid)
{
TogglePlayerDynamicCP(playerid, Checkpoint[GZONE],1);
TogglePlayerDynamicCP(playerid, Checkpoint[GAS],1);
TogglePlayerDynamicCP(playerid, Checkpoint[INDU],1);
TogglePlayerDynamicCP(playerid, Checkpoint[HOSP],1);
SetPlayerMapIcon(playerid,0,-316.7369,1594.6285,75.6609,53,19,2);
SetPlayerMapIcon(playerid,0,611.4569,1694.5847,6.9922,53,19,2);
SetPlayerMapIcon(playerid,0,199.9323,1422.9177,10.5859,53,19,2);
SetPlayerMapIcon(playerid,0,1089.3484,1076.1520,10.8359,53,19,2);
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == Checkpoint[GZONE])
{
if(tCP[GZONE] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
timer[playerid][GZONE] = SetTimerEx("SetZone",30000,false,"i",playerid);
GangZoneFlashForAll(GZONE, COLOR_PINK);
SendClientMessage(playerid,0xFFFFFF,"Capturing The Zone Don't Try to leave marker");
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",30000,false,"i",playerid);
GangZoneFlashForAll(GAS, COLOR_PINK);
SendClientMessage(playerid,0xFFFFFF,"Capturing The Zone Don't Try to leave marker");
iCP[playerid] = GAS;
}
if(checkpointid == Checkpoint[INDU])
{
if(tCP[INDU] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
timer[playerid][INDU] = SetTimerEx("SetZone",30000,false,"i",playerid);
GangZoneFlashForAll(INDU, COLOR_PINK);
SendClientMessage(playerid,0xFFFFFF,"Capturing The Zone Don't Try to leave marker");
iCP[playerid] = INDU;
}
if(checkpointid == Checkpoint[HOSP])
{
if(tCP[HOSP] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
timer[playerid][HOSP] = SetTimerEx("SetZone",30000,false,"i",playerid);
GangZoneFlashForAll(HOSP, COLOR_PINK);
SendClientMessage(playerid,0xFFFFFF,"Capturing The Zone Don't Try to leave marker");
iCP[playerid] = HOSP;
}
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == Checkpoint[GZONE])
{
KillTimer(timer[playerid][GZONE]);
SendClientMessage(playerid,RED,"Capturing Failed You have left the marker");
GangZoneStopFlashForAll(GZONE);
iCP[playerid] = -1;//None
}
if(checkpointid == Checkpoint[GAS])
{
KillTimer(timer[playerid][GAS]);
SendClientMessage(playerid,RED,"Capturing Failed You have left the marker");
GangZoneStopFlashForAll(GAS);
iCP[playerid] = -1;
}
if(checkpointid == Checkpoint[INDU])
{
KillTimer(timer[playerid][INDU]);
SendClientMessage(playerid,RED,"Capturing Failed You have left the marker");
GangZoneStopFlashForAll(INDU);
iCP[playerid] = -1;
}
if(checkpointid == Checkpoint[HOSP])
{
KillTimer(timer[playerid][HOSP]);
SendClientMessage(playerid,RED,"Capturing Failed You have left the marker");
GangZoneStopFlashForAll(HOSP);
iCP[playerid] = -1;
}
return 1;
}
forward SetZone(playerid);
public SetZone(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
GivePlayerMoney(playerid,1000);
SendClientMessage(playerid,LGREEN,"Congratulation! You have Gained 2 Scores & 1000$ Money ");
GangZoneStopFlashForAll(GZONE);
GangZoneStopFlashForAll(GAS);
GangZoneStopFlashForAll(INDU);
GangZoneStopFlashForAll(HOSP);
SetGangZone(playerid);
return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == GAS)
{
GangZoneShowForAll(Zone[GAS],GREENA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
SendClientMessageToAll(YELLOW,string);
tCP[GAS] = TEAM_PAKISTAN;
}
if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == GAS)
{
GangZoneShowForAll(Zone[GAS],ORANGEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured GasStation For Germany",pName);
SendClientMessageToAll(YELLOW,string);
tCP[GAS] = TEAM_GERMANY;
}
if(gTeam[playerid] == TEAM_USA && iCP[playerid] == GAS)
{
GangZoneShowForAll(Zone[GAS],BLUEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured GasStation For USA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[GAS] = TEAM_USA;
}
if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == GAS)
{
GangZoneShowForAll(Zone[GAS],REDA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured GasStation For RUSSIA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[GAS] = TEAM_RUSSIA;
}
if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == GAS)
{
GangZoneShowForAll(Zone[GAS],YELLOWA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured GasStation For INDIA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[GAS] = TEAM_INDIA;
}
//------------------------------------------------------------------------------
if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == GZONE)
{
GangZoneShowForAll(Zone[GZONE],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(YELLOW,string);
tCP[GZONE] = TEAM_PAKISTAN;
}
if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == GZONE)
{
GangZoneShowForAll(Zone[GZONE],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(YELLOW,string);
tCP[GZONE] = TEAM_GERMANY;
}
if(gTeam[playerid] == TEAM_USA&& iCP[playerid] == GZONE)
{
GangZoneShowForAll(Zone[GZONE],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(YELLOW,string);
tCP[GZONE] = TEAM_USA;
}
if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == GZONE)
{
GangZoneShowForAll(Zone[GZONE],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(YELLOW,string);
tCP[GZONE] = TEAM_RUSSIA;
}
if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == GZONE)
{
GangZoneShowForAll(Zone[GZONE],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(YELLOW,string);
tCP[GZONE] = TEAM_INDIA;
}
//------------------------------------------------------------------------------
if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == INDU)
{
GangZoneShowForAll(Zone[INDU],GREENA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Industry For Pakistan",pName);
SendClientMessageToAll(YELLOW,string);
tCP[INDU] = TEAM_PAKISTAN;
}
if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == INDU)
{
GangZoneShowForAll(Zone[INDU],ORANGEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Industry For Germany",pName);
SendClientMessageToAll(YELLOW,string);
tCP[INDU] = TEAM_GERMANY;
}
if(gTeam[playerid] == TEAM_USA&& iCP[playerid] == INDU)
{
GangZoneShowForAll(Zone[INDU],BLUEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Industry For USA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[INDU] = TEAM_USA;
}
if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == INDU)
{
GangZoneShowForAll(Zone[INDU],REDA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Industry For RUSSIA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[INDU] = TEAM_RUSSIA;
}
if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == INDU)
{
GangZoneShowForAll(Zone[INDU],YELLOWA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Industry For INDIA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[INDU] = TEAM_INDIA;
}
//------------------------------------------------------------------------------
if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == HOSP)
{
GangZoneShowForAll(Zone[HOSP],GREENA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Hospital For Pakistan",pName);
SendClientMessageToAll(YELLOW,string);
tCP[HOSP] = TEAM_PAKISTAN;
}
if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == HOSP)
{
GangZoneShowForAll(Zone[HOSP],ORANGEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Hospital For Germany",pName);
SendClientMessageToAll(YELLOW,string);
tCP[HOSP] = TEAM_GERMANY;
}
if(gTeam[playerid] == TEAM_USA&& iCP[playerid] == HOSP)
{
GangZoneShowForAll(Zone[HOSP],BLUEA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Hospital For USA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[HOSP] = TEAM_USA;
}
if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == HOSP)
{
GangZoneShowForAll(Zone[HOSP],REDA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Hospital For RUSSIA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[HOSP] = TEAM_RUSSIA;
}
if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == HOSP)
{
GangZoneShowForAll(Zone[HOSP],YELLOWA);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Server News: %s has captured Hospital For INDIA",pName);
SendClientMessageToAll(YELLOW,string);
tCP[HOSP] = TEAM_INDIA;
}
return 1;
}