Jump to content
  • 0

Problema Turfs


eXplosioN SAMP

Question

Problema intalnita (descriere): Pai, folosesc gm-ul pronion, si are acele turfuri , nu stiu cum sa fac ca la comanda /takezone sa se schimbe virtual world-ul celor 2 factiuni , cea care ataca si cea atacata 
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu):

Imagini / Video (optional):- 

if(strcmp(cmd,"/takezone",true)==0)
	{
        new member = PlayerInfo[playerid][pMember];
		new rank = PlayerInfo[playerid][pRank];
	    if(PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pLeader] == 15 || member == 12 && rank == 6 || member == 13 && rank == 6 || member == 14 && rank == 6 || member == 15 && rank == 6)
		{
			for(new z=0; z<sizeof(ZoneInfo); z++)
			{
			    if(IsPlayerInZone(playerid,z))
			    {
		            if(takezone == 1)
		            {
		                SendClientMessage(playerid, COLOR_GRAD1, "   The Takezone is allready started");
					}
					else
					{
					    new leader[30];
					    format(leader,sizeof(leader),"%s" ,ZoneInfo[GetPlayerZone(playerid)][zOwner]);
					    #define min 30000
						GetPlayerName(playerid, sendername, sizeof(sendername));

					    if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 12 && (PlayerInfo[playerid][pLeader] == 12 || member == 12 && rank == 6))
					    {
					        SendClientMessage(playerid, COLOR_GRAD1, "    Error. You are in an area of your");
					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 13 && (PlayerInfo[playerid][pLeader] == 13 || member == 13 && rank == 6))
					    {
					        SendClientMessage(playerid, COLOR_GRAD1, "    Error. You are in an area of your");
					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 14 && (PlayerInfo[playerid][pLeader] == 14 || member == 14 && rank == 6))
					    {
					        SendClientMessage(playerid, COLOR_GRAD1, "    Error. You are in an area of your");
					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 15 && (PlayerInfo[playerid][pLeader] == 15 || member == 15 && rank == 6))
					    {
					        SendClientMessage(playerid, COLOR_GRAD1, "    Error. You are in an area of your");
					    }
						if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 12 && (PlayerInfo[playerid][pLeader] == 13 || member == 13 && rank == 6))
		    			{
						    if(cooldownblls == 0)
							{
						        format(string, sizeof(string), "{FFFFFF}* {C21BE0}Ballas {FFFFFF}Leader %s is attacking a territory held by the {05A100}Grove Street{FFFFFF}!",sendername,leader);
						        SendClientMessageToAll(-1, string);
						        SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {C21BE0}12 minutes");
                                    foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }
						        takezone=1; Tmin = 11; Tsec = 0;
		                        ZoneInfo[z][zTakeOn] = 1;
		                        TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						    	timerbllsgst=SetTimer("bllsgst",min*20,0);
						    	bllsvsgst = 1;
						    	cooldownblls = 3600;
							}
							else
							{
								format(string, 128, "   Ballas has cooldown. Must wait 1 hour (%d seconds).",cooldownblls);
								SendClientMessage(playerid,COLOR_GREY, string);
							}
			    		}
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 12 && (PlayerInfo[playerid][pLeader] == 14 || member == 14 && rank == 6))
						{
						    if(cooldownlsv == 0)
							{
	      						format(string, sizeof(string), "{FFFFFF}* {F2EB16}Los Santos Vagos {FFFFFF}Leader %s is attacking a territory held by the {05A100}Grove Street{FFFFFF}!",sendername,leader);
						        SendClientMessageToAll( -1, string);
						        SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {F2EB16}12 minutes");
						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }
						        takezone= 1; Tmin = 11; Tsec = 0;
						        ZoneInfo[z][zTakeOn] = 1;
						        TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
		                        timerlsvgst=SetTimer("lsvgst",min*20,0);
		                        lsvvsgst = 1;
						    	cooldownlsv = 3600;
	                        }
							else
							{
								format(string, 128, "   Los Santos Vagos has cooldown. Must wait 1 hour (%d seconds).",cooldownlsv);
								SendClientMessage(playerid,COLOR_GREY, string);
							}
						}
		    			else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 12 && (PlayerInfo[playerid][pLeader] == 15 || member == 15 && rank == 6))
						{
						SendClientMessage(playerid, COLOR_GREY," You're in an alliance with Grove Street.");
						}
					 	else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 13 && (PlayerInfo[playerid][pLeader] == 12 || member == 12 && rank == 6))
						{
						    if(cooldowngst == 0)
							{
	         					format(string, sizeof(string), "{FFFFFF}* {05A100}Grove Street {FFFFFF}Leader %s is attacking a territory held by the {C21BE0}Ballas{FFFFFF}!",sendername,leader);
						        SendClientMessageToAll( -1, string);
						        SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {05A100}12 minutes");
						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }

						        takezone= 1; Tmin = 11; Tsec = 0;
						        ZoneInfo[z][zTakeOn] = 1;
						        TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						    	timergstblls=SetTimer("gstblls",min*20,0);
						    	cooldowngst = 3600;
						    	bllsvsgst = 1;
							}
	                        else
							{
								format(string, 128, "   Grove Street has cooldown. Must wait 1 hour (%d seconds).",cooldowngst);
								SendClientMessage(playerid,COLOR_GREY, string);
							}
	   					}
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 13 && (PlayerInfo[playerid][pLeader] == 14 || member == 14 && rank == 6))
					    {
						SendClientMessage(playerid, COLOR_GREY," You're in an alliance with Ballas.");
						}
		    			else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 13 && (PlayerInfo[playerid][pLeader] == 15 || member == 15 && rank == 6))
					    {
					        if(cooldownvla == 0)
							{
						        format(string, sizeof(string), "{FFFFFF}* {00F2FF}Varriors Los Aztecas {FFFFFF}Leader %s is attacking a territory held by the {C21BE0}Ballas{FFFFFF}!",sendername,leader);
		       					SendClientMessageToAll( -1, string);
		       					SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {00F2FF}12 minutes");
						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }
		       					takezone= 1; Tmin = 11; Tsec = 0;
		       					ZoneInfo[z][zTakeOn] = 1;
		       					TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						    	timervlablls=SetTimer("vlablls",min*20,0);
						    	vlavsblls = 1;
						    	cooldownvla = 3600;
						    }
						    else
							{
								format(string, 128, "   Varriors Los Aztecas has cooldown. Must wait 1 hour (%d seconds).",cooldownvla);
								SendClientMessage(playerid,COLOR_GREY, string);
							}
					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 14 && (PlayerInfo[playerid][pLeader] == 12 || member == 12 && rank == 6))
					    {
					        if(cooldowngst == 0)
							{
						        format(string, sizeof(string), "{FFFFFF}* {05A100}Grove Street {FFFFFF}Leader %s is attacking a territory held by the {F2EB16}Los Santos Vagos{FFFFFF}!",sendername,leader);
		       					SendClientMessageToAll( -1, string);
		       					SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {05A100}12 minutes");
						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }
		       					takezone= 1; Tmin = 11; Tsec = 0;
		       					ZoneInfo[z][zTakeOn] = 1;
		       					TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						    	timergstlsv=SetTimer("gstlsv",min*20,0);
						    	cooldowngst = 3600;
						    	lsvvsgst = 1;
					    	}
					    	else
					    	{
					    		format(string, 128, "   Grove Street has cooldown. Must wait 1 hour (%d seconds).",cooldowngst);
								SendClientMessage(playerid,COLOR_GREY, string);
					    	}

					    }
				     	else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 14 && (PlayerInfo[playerid][pLeader] == 13 || member == 13 && rank == 6))
					    {
				    	SendClientMessage(playerid, COLOR_GREY," You're in an alliance with Los Santos Vagos.");
					    }
				     	else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 14 && (PlayerInfo[playerid][pLeader] == 15 || member == 15 && rank == 6))
					    {
					        if(cooldownvla == 0)
							{
						        format(string, sizeof(string), "{FFFFFF}* {00F2FF}Varriors Los Aztecas {FFFFFF}Leader %s is attacking a territory held by the {F2EB16}Los Santos Vagos{FFFFFF}!",sendername,leader);
		       					SendClientMessageToAll( -1, string);
		       					SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {00F2FF}12 minutes");

						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }
		       					takezone= 1; Tmin = 11; Tsec = 0;
		       					ZoneInfo[z][zTakeOn] = 1;
		       					TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						    	timervlalsv=SetTimer("vlalsv",min*20,0);
						    	cooldownvla = 3600;
						    	vlavslsv = 1;
					    	}
	                        else
					    	{
					    		format(string, 128, "   Varriors Los Aztecas has cooldown. Must wait 1 hour (%d seconds).",cooldownvla);
								SendClientMessage(playerid,COLOR_GREY, string);
					    	}

					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 15 && (PlayerInfo[playerid][pLeader] == 12 || member == 12 && rank == 6))
					    {
					    SendClientMessage(playerid, COLOR_GREY," You're in an alliance with Varrios Los Aztecas.");
					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 15 && (PlayerInfo[playerid][pLeader] == 13 || member == 13 && rank == 6))
					    {
					        if(cooldownblls == 0)
							{
						        format(string, sizeof(string), "{FFFFFF}* {C21BE0}Ballas {FFFFFF}Leader %s is attacking a territory held by the {00F2FF}Varriors Los Aztecas{FFFFFF}!",sendername,leader);
		       					SendClientMessageToAll( -1, string);
		       					SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {C21BE0}12 minutes");

						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }

		       					takezone= 1; Tmin = 11; Tsec = 0;
		       					ZoneInfo[z][zTakeOn] = 1;
		       					TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						   		timerbllsvla=SetTimer("bllsvla",min*20,0);
						    	cooldownblls = 3600;
						   		vlavsblls = 1;
					   		}
					    	else
					    	{
					    		format(string, 128, "   Ballas has cooldown. Must wait 1 hour (%d seconds).",cooldownblls);
								SendClientMessage(playerid,COLOR_GREY, string);
					    	}

					    }
					    else if(ZoneInfo[GetPlayerZone(playerid)][zTeam] == 15 && (PlayerInfo[playerid][pLeader] == 14 || member == 14 && rank == 6))
					    {
					        if(cooldownlsv == 0)
							{
						        format(string, sizeof(string), "{FFFFFF}* {F2EB16}Los Santos Vagos {FFFFFF}Leader %s is attacking a territory held by the {00F2FF}Varriors Los Aztecas{FFFFFF}!",sendername,leader);
		       					SendClientMessageToAll( -1, string);
		       					SendClientMessageToAll(-1, "{FFFFFF}* Takezone Time: {F2EB16}12 minutes");
						        foreach(new i : Player)
					                {
							        GangZoneFlashForPlayer(i, Zones[z], COLOR_RED);
						            }
		       					takezone= 1; Tmin = 11; Tsec = 0;
		                        ZoneInfo[z][zTakeOn] = 1;
                                TakeStatsTimer = SetTimer("UpdateTakeStats", 1000,1);
						    	timerlsvvla=SetTimer("lsvvla",min*20,0);
						    	cooldownlsv = 3600;
						    	vlavslsv = 1;
					    	}
					    	else
					    	{
					    		format(string, 128, "   Los Santos Vagos has cooldown. Must wait 1 hour (%d seconds).",cooldownlsv);
								SendClientMessage(playerid,COLOR_GREY, string);
					    	}

					    }
					}
				}
			}
	    }
	    else SCM(playerid, COLOR_GRAD1, "   You are not a Gang Leader!");
	}
                                             /*-------------------Si comanda /takeover pentru admi---------------
                                           ------------------*/
                                             
                                             if(strcmp(cmd,"/takeover",true)==0)
	{
	    if(PlayerInfo[playerid][pAdmin] >= 1337)
	    {
	      	if(takezone == 1)
 		    {
			    	for(new z=0; z < sizeof(ZoneInfo); z++)
		    		{
				        takezone = 0; KillTimer(TakeStatsTimer);
				        ZoneInfo[z][zTakeOn] = 0;
			        	scoreteamgst=0;
						scoreteamblls=0;
						scoreteamlsv=0;
						scoreteamvla=0;
						bllsvsgst=0;
						lsvvsgst=0;
						vlavsgst=0;
						lsvvsblls=0;
						vlavsblls=0;
						vlavslsv=0;
						KillTimer(timerbllsgst);
						KillTimer(timerlsvgst);
						KillTimer(timervlagst);
						KillTimer(timergstblls);
						KillTimer(timerlsvblls);
						KillTimer(timervlablls);
						KillTimer(timergstlsv);
						KillTimer(timerbllslsv);
						KillTimer(timervlalsv);
				        KillTimer(timergstvla);
						KillTimer(timerbllsvla);
						KillTimer(timerlsvvla);

						for(new i=0; i < sizeof(ZoneInfo); i++)
	                            {
                                GangZoneHideForAll( Zones[i]);
	    		                GangZoneShowForAll( Zones[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
                                }
						GangZoneStopFlashForAll(Zones[z]);
						cooldownblls = 0;
						cooldowngst = 0;
						cooldownlsv = 0;
						cooldownvla = 0;
					}
					new text[256];
		   			GetPlayerName(playerid,sendername,sizeof(sendername));
					format(text, sizeof(text), "[TakeZone]:  {FFFFFF}The Takezone was stopped by admin {FF0000}%s",sendername);
					SendClientMessageToAll(COLOR_LIGHTGREEN, text);
			}
			else SendClientMessage(playerid, COLOR_GRAD1, "   Nu este pornit niciun takezone!");
	    }
	}
//------

Ati incercat sa rezolvati singur?:  Nu stiu ce sa incerc

P.S Daca cineva stie , ar puteam sa-mi spuna si cum fac sa se si respawneze membrii celor 2 factiuni !

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.