anti teamjack
#1

when pressing G it also kills the person.

Help pl0x?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  for(new i; i < GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
    {
      if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerTeam(i) == GetPlayerTeam(playerid))
      {
                SetPlayerHeatlh(playerid, 0);
      }
    }
  }
  return 1;
}
Reply
#2

The ispassenger parameter can be used for that.

pawn Код:
if (ispassenger) return 1; // At the beginning of the function
Reply
#3

Thanks, it worked (Y)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)