Kill Point only in special Zone
#1

hello i have this in my gamemod

Code:
public OnPlayerDeath(playerid, killerid, reason)
{
	if(gTeam[playerid]==TEAM_GG && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
		{
       SendClientMessageToAll(0xFFB400FF, "Team 1 make a point!");

	GivePlayerMoney(playerid, 100);
	SCC++;	}
	if(gTeam[playerid]==TEAM_CC && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
		{
    	SendClientMessageToAll(0xFFB400FF, "Team 2 make a point!");
	GivePlayerMoney(playerid, 100);
	SGG ++;
	}
	if(SCC==50)
	{
		for(new i=50; i < MAX_PLAYERS; i++)
		{
			GameTextForAll("~y~ Team 1 win",10000,3);
			ForceClassSelection(playerid);
			SCC=0;
			SGG=0;
			new string2[5];
			valstr(string2, SCC);
			TextDrawSetString(TextCC, string2);
			valstr(string2, SGG);
			TextDrawSetString(TextGG, string2);
        }
		SendClientMessageToAll(0xFFB400FF,"**Team 1 win**");
	}
	if(SGG==50)
	{
		for(new i=50; i < MAX_PLAYERS; i++)
		{
			GameTextForAll("~g~Team 2 win",10000,3);
			ForceClassSelection(playerid);
			SCC=0;
			SGG=0;
			new string3[5];
			valstr(string3, SCC);
			TextDrawSetString(TextCC, string3);
			valstr(string3, SGG);
			TextDrawSetString(TextGG, string3);
        }
		SendClientMessageToAll(0x00FF14FF,"** Team 2 win **");
 	}
	if(killerid != INVALID_PLAYER_ID)
	{
		SetPlayerScore(killerid, GetPlayerScore(killerid));
		}
	return 1;
}
i want make a area "(-934.23,1389.667,-572.2159,1658.25)" only in this area can i make a point for my team "SCC++;" how is wrong in my script what can i do ?
Reply
#2

mayb usin a 'else' ex:
pawn Code:
if(gTeam[playerid]==TEAM_GG && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
    {
        //any here
    }
    else
    if(gTeam[playerid]==TEAM_CC && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
    {
        //more here
    }
    else//if you have more...
Reply
#3

Code:
E:\.pwn(442) : warning 213: tag mismatch
E:\.pwn(442) : warning 202: number of arguments does not match definition
E:\.pwn(442) : error 029: invalid expression, assumed zero
this error is here:

Code:
if(gTeam[playerid]==TEAM_Cops && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258)))
Reply
#4

You forgot the 'playerid' parameter in IsPlayerInArea
Reply
#5

thanks it works !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)