"Players in the same team cant kill each other", aha -.-
#1

Hey guys!
(I am a newby)

I have got a nasty problem: tk'ers.
Players in the same team can kill each other on my server.

Here my idea:

I set the team of the player when he select the Class X.

Код:
public OnPlayerRequestClass(playerid,classid)
{
   switch(classid)
  {
   // .....
     case 0: // Army
     {
       //...
       teamid[playerid]=0;
     }
  }
}
And set the team directly when he spawns

Код:
public OnPlayerSpawn(playerid)
{
   switch(teamid[playerid])
  {
   // .....
     case 0: // Army
     {
       //...
       SetPlayerTeam(playerid, 0);
     }
  }
}
But sometimes, they can kill each other..

why ??

PS: I solved the problem with a kick(playerid); in OnPlayerDeath(playerid,killerid,reason): if(teamid[..]==teamid[..]) kick(..);
But .. thats not very nice =/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)