war sistem
#1

i make a function
Код:
public IsInTurf(playerid)
{
	new Float:xa, Float:ya, Float:za;
	GetPlayerPos(playerid, xa, ya, za);
	for(new i=0;i<MAX_TURF;i++)
	{
		if(xa > TurfInfo[i][MinX] && xa < TurfInfo[i][MaxX] && ya > TurfInfo[i][MinY] && ya < TurfInfo[i][MaxY])
		{
			terid = i;
			return 1;
		}
	}
	return 0;
}
Код:
if(strcmp(cmd, "/testwar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pLiderr] == 5 || PlayerInfo[playerid][pLiderr] == 6 || PlayerInfo[playerid][pLiderr] == 18 || PlayerInfo[playerid][pLiderr] == 19 || PlayerInfo[playerid][pLiderr] == 14 || PlayerInfo[playerid][pLiderr] == 20)
		 	{
	        	if(IsInTurf(playerid))
	        	{
	        	    if(TurfInfo[terid][CodTime] <= 0)
	        	    {
          				new team1;
              			new team2;
                        teamr1 = PlayerInfo[playerid][pLiderr];
                        teamr2 = TurfInfo[terid][Owner];
		            	for(new i=0; i<MAX_PLAYERS; i++)
						{
							if(IsPlayerConnected(i))
							{
			    				if(PlayerInfo[i][pMembruu] == PlayerInfo[playerid][pLiderr] || PlayerInfo[i][pLiderr] == PlayerInfo[playerid][pLiderr])
							    {
			        				team1++;
								}
								if(PlayerInfo[i][pMembruu] == TurfInfo[terid][Owner] || PlayerInfo[i][pLiderr] == TurfInfo[terid][Owner])
								{
				    				team2++;
								}
							}
							if(team1 >= 1 && team2 >= 1)
							{
								StartWar();
       							new Text:TDatack = TextDrawCreate(200.0, 385.0, "~w~test1");
             					TextDrawFont(TDatack, 0);
								TextDrawSetShadow(TDatack, 0);
								TextDrawSetOutline(TDatack, 1);
								TextDrawColor(TDatack, 0xDFDFDFFF);
								TimeTextForPlayer(playerid, TDatack, 10000);
								format(string, sizeof(string), "Id teritoriu: %d .", terid);
								SendClientMessage(playerid, COLOR_LIGHTRED, string);
	            				SendClientMessage(playerid, 0xDFDFDFFF, "Merge teava");
							}
						}
   					}
					else
					{
						format(string, sizeof(string), "Trebuie sa mai astepti %d pentru a face alt war.", TurfInfo[terid][CodTime]);
						SendClientMessage(playerid, COLOR_LIGHTRED, string);
					}
   				}
         		else
 				{
				 	SendClientMessage(playerid, 0xDFDFDFFF, "Nu te aflii pe un teritoriu");
		 		}
			}
			else SendClientMessage(playerid, 0xDFDFDFFF, "Nu esti lider la o mafie!");
    	}
	}
always type Nu te aflii pe un teritoriu...why ?
Reply
#2

up up
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)