14.06.2011, 02:48
How to Make a Anti-Team_kill Using
pawn Код:
gTeam //?
gTeam //?
enum E_TEAMS ( <<= 1 )
{
TEAM_VAGOS,
TEAM_GROVE
}
new E_TEAMS: gTeam[ MAX_PLAYERS ] = { TEAM_VAGOS, ... };
public OnPlayerRequestClass( playerid, classid )
{
switch ( classid )
{
case 0: gTeam[ playerid ] = TEAM_VAGOS;
}
return 1;
}
public OnPlayerDeath( playerid, killerid, reason )
{
if ( gTeam[ killerid ] == gTeam[ playerid ] )
{
GameTextForPlayer( killerid, "~w~BANNED FOR TEAMKILLING", 1000, 3 );
Ban( killerid );
}
return 1;
}