Will this work? (Anti team kill) (rep++)
#1

I did this for Anti-Team Killing. So will this work?? I only want that player of same team can not hurt each other.... So will this work. if not then plzz tell me how??

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerTeam(playerid, TEAM_PAKISTAN);
    SetPlayerTeam(playerid, TEAM_GERMANY);
    SetPlayerTeam(playerid, TEAM_USA);
    SetPlayerTeam(playerid, TEAM_RUSSIA);
    SetPlayerTeam(playerid, TEAM_INDIA);
Reply
#2

nope wont work

you can only set one team at once, when you set another team right after another, it will override the last team.
Reply
#3

So how can it work?? Please Help me..
Reply
#4

why you dont make players select His/her class ? will be easier
Reply
#5

Are'nt you stealing my script ROFL [I almost have same teams in my new GM]? I guess you're from India as noone will ever add India And Pakistan in teams.

You have gTeams[MAX_PLAYERS]; Declared in your game mode? Then use this.
pawn Код:
forward SetTeamToPlayer(playerid);
public SetTeamToPlayer(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(gTeam[playerid] == TEAM_INDIA) { SetPlayerTeam(playerid, TEAM_INDIA); }
        else if(gTeam[playerid] == TEAM_GERMANY) { SetPlayerTeam(playerid, TEAM_GERMANY); }
        else if(gTeam[playerid] == TEAM_USA) { SetPlayerTeam(playerid, TEAM_USA); }
        else if(gTeam[playerid] == TEAM_RUSSIA) { SetPlayerTeam(playerid, TEAM_RUSSIA); }
        else if(gTeam[playerid] == TEAM_PAKISTAN) { SetPlayerTeam(playerid, TEAM_PAKISTAN); }
    }
    return 1;
}

//Add this line under OnPlayerSpawn(playerid)
SetTeamToPlayer(playerid);
Reply
#6

It is compiling perfect. I'll check it out later. Thnks for help. (Reped all)
Reply
#7

Quote:
Originally Posted by iOmar
Посмотреть сообщение
It is compiling perfect. I'll check it out later. Thnks for help. (Reped all)
Cool. Btw you're from India right? XD Goodluck with your CW Script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)